ControllerInterface/Xlib: Combine keycodes with the same name to fix non-working inputs.

This commit is contained in:
Jordan Woyak
2025-06-12 04:50:13 -05:00
parent a163877413
commit 4f3e527186
2 changed files with 50 additions and 20 deletions
@@ -6,6 +6,8 @@
#pragma once
#include <array>
#include <string>
#include <vector>
extern "C" {
#include <X11/Xlib.h>
@@ -39,15 +41,20 @@ private:
friend class KeyboardMouse;
public:
Key(std::string name, KeyCode keycode, const char* keyboard);
std::string GetName() const override { return m_keyname; }
Key(Display* display, KeyCode keycode, const char* keyboard);
ControlState GetState() const override;
static const char* GetNameForKeyCode(Display* display, KeyCode keycode);
private:
std::string m_keyname;
Display* const m_display;
void AddKeyCode(KeyCode);
bool IsKeyCodePressed(KeyCode) const;
const std::string m_keyname;
const char* const m_keyboard;
const KeyCode m_keycode;
std::vector<KeyCode> m_keycodes;
};
class Button : public Input