From bbb12a7560b0f8e44ef3881e11e60c9db6e8449d Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 19 Oct 2020 10:21:28 -0500 Subject: Linux/XInput2: Fix keys being stuck pressed on focus loss. --- Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h') diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index af452725fc..a9442b6332 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -6,6 +6,8 @@ #pragma once +#include + extern "C" { #include #include @@ -24,7 +26,7 @@ class KeyboardMouse : public Core::Device private: struct State { - char keyboard[32]; + std::array keyboard; unsigned int buttons; Common::Vec2 cursor; Common::Vec2 axis; @@ -90,7 +92,7 @@ private: }; private: - void SelectEventsForDevice(Window window, XIEventMask* mask, int deviceid); + void SelectEventsForDevice(XIEventMask* mask, int deviceid); void UpdateCursor(); public: @@ -106,8 +108,9 @@ private: Window m_window; Display* m_display; State m_state{}; - int xi_opcode; - const int pointer_deviceid, keyboard_deviceid; + const int xi_opcode; + const int pointer_deviceid; + const int keyboard_deviceid; std::string name; }; } // namespace ciface::XInput2 -- cgit v1.2.3