summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-10-21 20:47:32 +0200
committerGitHub <noreply@github.com>2020-10-21 20:47:32 +0200
commit97de366b0fdea057e9595f977991fda55e3ddb15 (patch)
tree0d30613fcb6593592afd438758aef109fa37a3f9 /Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
parent43d11ca3eb424e6582fa8e54da5fb0c966be12c5 (diff)
parentbbb12a7560b0f8e44ef3881e11e60c9db6e8449d (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.h11
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