mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12:00
Savestates/Mouse: Fix Mouse handler use
This commit is contained in:
parent
649714429b
commit
bceaf46e2f
3 changed files with 9 additions and 8 deletions
|
@ -213,12 +213,6 @@ void raw_mouse::update_values(const RAWMOUSE& state)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
raw_mouse_handler::raw_mouse_handler(bool is_for_gui)
|
|
||||||
: MouseHandlerBase()
|
|
||||||
, m_is_for_gui(is_for_gui)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
raw_mouse_handler::~raw_mouse_handler()
|
raw_mouse_handler::~raw_mouse_handler()
|
||||||
{
|
{
|
||||||
if (m_thread)
|
if (m_thread)
|
||||||
|
|
|
@ -65,11 +65,17 @@ private:
|
||||||
class raw_mouse_handler final : public MouseHandlerBase
|
class raw_mouse_handler final : public MouseHandlerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
raw_mouse_handler(bool is_for_gui = false);
|
using MouseHandlerBase::MouseHandlerBase;
|
||||||
|
|
||||||
virtual ~raw_mouse_handler();
|
virtual ~raw_mouse_handler();
|
||||||
|
|
||||||
void Init(const u32 max_connect) override;
|
void Init(const u32 max_connect) override;
|
||||||
|
|
||||||
|
void SetIsForGui(bool value)
|
||||||
|
{
|
||||||
|
m_is_for_gui = value;
|
||||||
|
}
|
||||||
|
|
||||||
const std::map<void*, raw_mouse>& get_mice() const { return m_raw_mice; };
|
const std::map<void*, raw_mouse>& get_mice() const { return m_raw_mice; };
|
||||||
|
|
||||||
void set_mouse_press_callback(std::function<void(const std::string&, s32, bool)> cb)
|
void set_mouse_press_callback(std::function<void(const std::string&, s32, bool)> cb)
|
||||||
|
|
|
@ -65,7 +65,8 @@ raw_mouse_settings_dialog::raw_mouse_settings_dialog(QWidget* parent)
|
||||||
|
|
||||||
constexpr u32 max_devices = 16;
|
constexpr u32 max_devices = 16;
|
||||||
|
|
||||||
g_raw_mouse_handler = std::make_unique<raw_mouse_handler>(true);
|
g_raw_mouse_handler = std::make_unique<raw_mouse_handler>();
|
||||||
|
g_raw_mouse_handler->SetIsForGui(true);
|
||||||
g_raw_mouse_handler->Init(std::max(max_devices, ::size32(g_cfg_raw_mouse.players)));
|
g_raw_mouse_handler->Init(std::max(max_devices, ::size32(g_cfg_raw_mouse.players)));
|
||||||
g_raw_mouse_handler->set_mouse_press_callback([this](const std::string& device_name, s32 cell_code, bool pressed)
|
g_raw_mouse_handler->set_mouse_press_callback([this](const std::string& device_name, s32 cell_code, bool pressed)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue