diff options
author | taiyu <taiyu.len@gmail.com> | 2015-08-19 20:22:15 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-08-19 20:22:15 -0700 |
commit | 5ff0619ca1cab044004df044c253c9170b8316c3 (patch) | |
tree | 7872a66e494acb90dd08ffc76665557b0e0ca874 /include/input_state.h | |
parent | key_state.ch, and command conflicts resolved (diff) | |
download | sway-5ff0619ca1cab044004df044c253c9170b8316c3.tar.gz sway-5ff0619ca1cab044004df044c253c9170b8316c3.tar.zst sway-5ff0619ca1cab044004df044c253c9170b8316c3.zip |
input state, find_container_in_direction
Diffstat (limited to 'include/input_state.h')
-rw-r--r-- | include/input_state.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/input_state.h b/include/input_state.h new file mode 100644 index 00000000..782b4b19 --- /dev/null +++ b/include/input_state.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _SWAY_KEY_STATE_H | ||
2 | #define _SWAY_KEY_STATE_H | ||
3 | #include <stdbool.h> | ||
4 | #include <stdint.h> | ||
5 | #include "container.h" | ||
6 | |||
7 | /* Keyboard state */ | ||
8 | |||
9 | typedef uint32_t keycode; | ||
10 | |||
11 | // returns true if key has been pressed, otherwise false | ||
12 | bool check_key(keycode key); | ||
13 | |||
14 | // sets a key as pressed | ||
15 | void press_key(keycode key); | ||
16 | |||
17 | // unsets a key as pressed | ||
18 | void release_key(keycode key); | ||
19 | |||
20 | /* Pointer state */ | ||
21 | |||
22 | enum pointer_values { | ||
23 | M_LEFT_CLICK = 272, | ||
24 | M_RIGHT_CLICK = 273, | ||
25 | M_SCROLL_CLICK = 274, | ||
26 | M_SCROLL_UP = 275, | ||
27 | M_SCROLL_DOWN = 276, | ||
28 | }; | ||
29 | |||
30 | extern struct pointer_state { | ||
31 | bool l_held; | ||
32 | bool r_held; | ||
33 | struct pointer_floating { | ||
34 | bool drag; | ||
35 | bool resize; | ||
36 | } floating; | ||
37 | struct pointer_lock { | ||
38 | bool left; | ||
39 | bool right; | ||
40 | bool top; | ||
41 | bool bottom; | ||
42 | } lock; | ||
43 | } pointer_state; | ||
44 | |||
45 | void start_floating(swayc_t *view); | ||
46 | void reset_floating(swayc_t *view); | ||
47 | |||
48 | #endif | ||
49 | |||