diff options
| author | Jeffrey Bosboom <jbosboom@jeffreybosboom.com> | 2023-04-15 02:13:00 -0700 |
|---|---|---|
| committer | Jeffrey Bosboom <jbosboom@jeffreybosboom.com> | 2023-05-19 14:20:09 -0700 |
| commit | a902480cb053478af3f8df25aab8a36395685378 (patch) | |
| tree | f70ca396f156b0023e0a495c5b58e5032edb7764 /Source/Core/InputCommon/ControllerInterface/Xlib | |
| parent | 4efa10c170f6c758311d3ac607174633cb716ffc (diff) | |
XInput2: Make button state a u32
Because we care how many bits it has, not its arithmetic range. No
functional change on all supported platforms.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Xlib')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp index 07d8e4bfa5..db7052996c 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp @@ -441,8 +441,7 @@ ControlState KeyboardMouse::Key::GetState() const return (m_keyboard[m_keycode / 8] & (1 << (m_keycode % 8))) != 0; } -KeyboardMouse::Button::Button(unsigned int index, unsigned int* buttons) - : m_buttons(buttons), m_index(index) +KeyboardMouse::Button::Button(unsigned int index, u32* buttons) : m_buttons(buttons), m_index(index) { name = fmt::format("Click {}", m_index + 1); } diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index ff2c787b1d..52c78ab752 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -13,6 +13,7 @@ extern "C" { #include <X11/keysym.h> } +#include "Common/CommonTypes.h" #include "Common/Matrix.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" @@ -26,7 +27,7 @@ private: struct State { std::array<char, 32> keyboard; - unsigned int buttons; + u32 buttons; Common::Vec2 cursor; Common::Vec3 axis; Common::Vec3 relative_mouse; @@ -52,11 +53,11 @@ private: { public: std::string GetName() const override { return name; } - Button(unsigned int index, unsigned int* buttons); + Button(unsigned int index, u32* buttons); ControlState GetState() const override; private: - const unsigned int* m_buttons; + const u32* m_buttons; const unsigned int m_index; std::string name; }; |
