Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savestates/Mouse: Fix Mouse handler use #15717

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions rpcs3/Input/raw_mouse_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ void raw_mouse::update_values(const RAWMOUSE& state)
}
#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()
{
if (m_thread)
Expand Down
8 changes: 7 additions & 1 deletion rpcs3/Input/raw_mouse_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ class raw_mouse
class raw_mouse_handler final : public MouseHandlerBase
{
public:
raw_mouse_handler(bool is_for_gui = false);
using MouseHandlerBase::MouseHandlerBase;

virtual ~raw_mouse_handler();

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; };

void set_mouse_press_callback(std::function<void(const std::string&, s32, bool)> cb)
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/rpcs3qt/raw_mouse_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ raw_mouse_settings_dialog::raw_mouse_settings_dialog(QWidget* parent)

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->set_mouse_press_callback([this](const std::string& device_name, s32 cell_code, bool pressed)
{
Expand Down