diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-21 20:47:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-21 20:47:32 +0200 |
| commit | 97de366b0fdea057e9595f977991fda55e3ddb15 (patch) | |
| tree | 0d30613fcb6593592afd438758aef109fa37a3f9 /Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h | |
| parent | 43d11ca3eb424e6582fa8e54da5fb0c966be12c5 (diff) | |
| parent | bbb12a7560b0f8e44ef3881e11e60c9db6e8449d (diff) | |
Merge pull request #9160 from jordan-woyak/xinput2-stuck-keys
Linux/XInput2: Fix keys being stuck pressed on focus loss.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h | 11 |
1 files changed, 7 insertions, 4 deletions
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 <array> + extern "C" { #include <X11/Xlib.h> #include <X11/extensions/XInput2.h> @@ -24,7 +26,7 @@ class KeyboardMouse : public Core::Device private: struct State { - char keyboard[32]; + std::array<char, 32> 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 |
