diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-30 22:27:24 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-30 22:27:24 -0500 |
commit | 185bf5b364efb4d7885ff5adcb69204e892ff5f7 (patch) | |
tree | 8bacf74b81e15ab71a0badb6a7c3492e47a2c662 /ted-base.c | |
parent | e6ec7b7baa9a0a52c3becb0ef43bb3285232b999 (diff) |
config working!
Diffstat (limited to 'ted-base.c')
-rw-r--r-- | ted-base.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,15 +1,18 @@ typedef struct { u32 line_number; // config line number where this was set - Command command; + Command command; // this will be 0 (COMMAND_UNKNOWN) if there's no action for the key i64 argument; } KeyAction; #define SCANCODE_COUNT 0x120 // SDL scancodes should be less than this value. // a "key combo" is some subset of {control, shift, alt} + some key. #define KEY_COMBO_COUNT (SCANCODE_COUNT << 3) -#define KEY_MODIFIER_CTRL 1 -#define KEY_MODIFIER_SHIFT 2 -#define KEY_MODIFIER_ALT 4 +#define KEY_MODIFIER_CTRL_BIT 0 +#define KEY_MODIFIER_SHIFT_BIT 1 +#define KEY_MODIFIER_ALT_BIT 2 +#define KEY_MODIFIER_CTRL (1<<KEY_MODIFIER_CTRL_BIT) +#define KEY_MODIFIER_SHIFT (1<<KEY_MODIFIER_SHIFT_BIT) +#define KEY_MODIFIER_ALT (1<<KEY_MODIFIER_ALT_BIT) // ctrl+alt+c is encoded as SDL_SCANCODE_C << 3 | KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT typedef struct { |