Implementing X11Scancodes

This commit is contained in:
2024-01-04 17:26:41 -05:00
parent 6afccc34a5
commit eed5f10413
2 changed files with 41 additions and 37 deletions

View File

@@ -23,19 +23,19 @@ public:
namespace Keys {
static const Key Escape;
static const Key F1;
static const Key F2;
static const Key F3;
static const Key F4;
static const Key F5;
static const Key F6;
static const Key F7;
static const Key F8;
static const Key F9;
static const Key F10;
static const Key F11;
static const Key F12;
static const Key Escape {'\b', X11Scancode::ESCAPE};
static const Key F1 {'\u000f', X11Scancode::FUNCTION_ONE};
static const Key F2 {'\u000f', X11Scancode::FUNCTION_TWO};
static const Key F3 {'\u000f', X11Scancode::FUNCTION_THREE};
static const Key F4 {'\u000f', X11Scancode::FUNCTION_FOUR};
static const Key F5 {'\u000f', X11Scancode::FUNCTION_FIVE};
static const Key F6 {'\u000f', X11Scancode::FUNCTION_SIX};
static const Key F7 {'\u000f', X11Scancode::FUNCTION_SEVEN};
static const Key F8 {'\u000f', X11Scancode::FUNCTION_EIGHT};
static const Key F9 {'\u000f', X11Scancode::FUNCTION_NINE};
static const Key F10 {'\u000f', X11Scancode::FUNCTION_TEN};
static const Key F11 {'\u000f', X11Scancode::FUNCTION_ELEVEN};
static const Key F12 {'\u000f', X11Scancode::FUNCTION_TWELVE};
static const Key NumPad1;
static const Key NumPad2;
@@ -53,27 +53,28 @@ namespace Keys {
static const Key W {'W', X11Scancode::W};
static const Key E {'E', X11Scancode::E};
static const Key R {'R', X11Scancode::R};
static const Key T;
static const Key Y;
static const Key U;
static const Key I;
static const Key O;
static const Key P;
static const Key A;
static const Key S;
static const Key D;
static const Key F;
static const Key G;
static const Key H;
static const Key J;
static const Key K;
static const Key L;
static const Key Semicolon;
static const Key Comma;
static const Key Enter;
static const Key Minus;
static const Key Equals;
static const Key Tilde;
static const Key T {'T', X11Scancode::T};
static const Key Y {'Y', X11Scancode::Y};
static const Key U {'U', X11Scancode::U};
static const Key I {'I', X11Scancode::I};
static const Key O {'O', X11Scancode::O};
static const Key P {'P', X11Scancode::P};
static const Key A {'A', X11Scancode::A};
static const Key S {'S', X11Scancode::S};
static const Key D {'D', X11Scancode::D};
static const Key F {'F', X11Scancode::F};
static const Key G {'G', X11Scancode::G};
static const Key H {'H', X11Scancode::H};
static const Key J {'J', X11Scancode::J};
static const Key K {'K', X11Scancode::K};
static const Key L {'L', X11Scancode::L};
static const Key Semicolon {';', X11Scancode::SEMICOLON};
static const Key SingeQuote {'\'', X11Scancode::SINGLEQUOTE};
static const Key Enter {'\n', X11Scancode::RETURN};
static const Key KeyPadEnter {'\n', X11Scancode::KP_RETURN};
static const Key Minus {'-', X11Scancode::MINUS};
static const Key KeyPadMinus {'-', X11Scancode::KP_MINUS};
static const Key Equals {'=', X11Scancode::EQUALS};
static const Key Z;
static const Key X;
static const Key C;
@@ -85,6 +86,12 @@ namespace Keys {
static const Key Slash;
static const Key LShift;
static const Key RShift;
// TODO: Get the right character codes for these
static const Key UpArrow {'\u000a', X11Scancode::UP};
static const Key DownArrow {'\u000a', X11Scancode::DOWN};
static const Key LeftArrow {'\u000a', X11Scancode::LEFT};
static const Key RightArrow {'\u000a', X11Scancode::RIGHT};
}
class GamepadButton {};

View File

@@ -46,7 +46,6 @@ enum class CursorStyle
LeftSide,
Plus,
RightSide,
};
using namespace std::chrono_literals;
@@ -87,8 +86,6 @@ public:
GamepadState Gamepad;
};
class KeyboardEvent : public RWindowEvent {
public:
Key key;