diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-23 15:28:49 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-23 15:28:49 -0400 |
commit | 1ac0c8cd47f734809c20bf6a6a0a7278680ed597 (patch) | |
tree | c15286165247ae28a192f66aa5886f1d956c5b07 /include/input_state.h | |
parent | Merge pull request #123 from Luminarys/master (diff) | |
download | sway-1ac0c8cd47f734809c20bf6a6a0a7278680ed597.tar.gz sway-1ac0c8cd47f734809c20bf6a6a0a7278680ed597.tar.zst sway-1ac0c8cd47f734809c20bf6a6a0a7278680ed597.zip |
Refactor keyboard to consider modified keysyms
Press Shift
Press 0 # Reads as ')'
Release Shift
Release 0 # Reads as '0' but we now recognize it as the same
Diffstat (limited to 'include/input_state.h')
-rw-r--r-- | include/input_state.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/input_state.h b/include/input_state.h index 04fde42d..29064fd0 100644 --- a/include/input_state.h +++ b/include/input_state.h | |||
@@ -6,16 +6,14 @@ | |||
6 | 6 | ||
7 | /* Keyboard state */ | 7 | /* Keyboard state */ |
8 | 8 | ||
9 | typedef uint32_t keycode; | ||
10 | |||
11 | // returns true if key has been pressed, otherwise false | 9 | // returns true if key has been pressed, otherwise false |
12 | bool check_key(keycode key); | 10 | bool check_key(uint32_t key_sym, uint32_t key_code); |
13 | 11 | ||
14 | // sets a key as pressed | 12 | // sets a key as pressed |
15 | void press_key(keycode key); | 13 | void press_key(uint32_t key_sym, uint32_t key_code); |
16 | 14 | ||
17 | // unsets a key as pressed | 15 | // unsets a key as pressed |
18 | void release_key(keycode key); | 16 | void release_key(uint32_t key_sym, uint32_t key_code); |
19 | 17 | ||
20 | /* Pointer state */ | 18 | /* Pointer state */ |
21 | 19 | ||