diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-07-24 11:05:50 +0200 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-07-24 11:11:23 +0200 |
commit | e7dc403c36d5958238691578610d442a27ecc943 (patch) | |
tree | 95ad6a7f74acf736c5d423c8742496761dd436e7 /code/x11_key_to_keysym.c | |
parent | 4ab197add10847d4ba3036ed525f96db00a9849f (diff) |
checkpoint
Diffstat (limited to 'code/x11_key_to_keysym.c')
-rw-r--r-- | code/x11_key_to_keysym.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/code/x11_key_to_keysym.c b/code/x11_key_to_keysym.c new file mode 100644 index 0000000..57c8841 --- /dev/null +++ b/code/x11_key_to_keysym.c @@ -0,0 +1,51 @@ +@table(Name, KeySym) KeyboardButtons +{ + { Return XK_Return } + { Delete XK_Delete } + { BackSpace XK_BackSpace } + { Home XK_KP_Home } + { End XK_KP_End } + { PageUp XK_KP_Prior } + { PageDown XK_KP_Next } + { Control XK_Control_L } + { Shift XK_Shift_L } + { Alt XK_Alt_L } + { Insert XK_Insert } + { Escape XK_Escape } + { Up XK_Up } + { Down XK_Down } + { Left XK_Left } + { Right XK_Right } + { F1 XK_F1 } + { F2 XK_F2 } + { F3 XK_F3 } + { F4 XK_F4 } + { F5 XK_F5 } + { F6 XK_F6 } + { F7 XK_F7 } + { F8 XK_F8 } + { F9 XK_F9 } + { F10 XK_F10 } + { F11 XK_F11 } + { F12 XK_F12 } +} + + +if(0) {} +@expand(KeyboardButtons k) +`if\(Symbol == $(k.KeySym)\) +{ + LinuxProcessKeyPress\(&KeyboardController->Keyboard.$(k.Name), IsDown\); +}` + +@expand(KeyboardButtons k) +`game_button_state $(k.Name)` + +typedef enum +{ +@expand(KeyboardButtons k) ` PlatformKeyboardButton_$(k.Name),` + PlatformKeyboardButton_Count +} platform_keyboard_buttons; + +@count(KeyboardButtons) + |