diff options
-rw-r--r-- | include/input_state.h | 1 | ||||
-rw-r--r-- | sway/config.c | 3 | ||||
-rw-r--r-- | sway/input_state.c | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/input_state.h b/include/input_state.h index 782b4b19..a7e0c1ca 100644 --- a/include/input_state.h +++ b/include/input_state.h | |||
@@ -44,6 +44,7 @@ extern struct pointer_state { | |||
44 | 44 | ||
45 | void start_floating(swayc_t *view); | 45 | void start_floating(swayc_t *view); |
46 | void reset_floating(swayc_t *view); | 46 | void reset_floating(swayc_t *view); |
47 | void input_init(void); | ||
47 | 48 | ||
48 | #endif | 49 | #endif |
49 | 50 | ||
diff --git a/sway/config.c b/sway/config.c index 9f65e8a2..0afb0205 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "commands.h" | 9 | #include "commands.h" |
10 | #include "config.h" | 10 | #include "config.h" |
11 | #include "layout.h" | 11 | #include "layout.h" |
12 | #include "input_state.h" | ||
12 | 13 | ||
13 | struct sway_config *config; | 14 | struct sway_config *config; |
14 | 15 | ||
@@ -147,6 +148,8 @@ _continue: | |||
147 | bool load_config(const char *file) { | 148 | bool load_config(const char *file) { |
148 | sway_log(L_INFO, "Loading config"); | 149 | sway_log(L_INFO, "Loading config"); |
149 | 150 | ||
151 | input_init(); | ||
152 | |||
150 | char *path; | 153 | char *path; |
151 | if (file != NULL) { | 154 | if (file != NULL) { |
152 | path = strdup(file); | 155 | path = strdup(file); |
diff --git a/sway/input_state.c b/sway/input_state.c index a7f88d4a..7f312c54 100644 --- a/sway/input_state.c +++ b/sway/input_state.c | |||
@@ -8,6 +8,13 @@ | |||
8 | 8 | ||
9 | static keycode key_state_array[KEY_STATE_MAX_LENGTH]; | 9 | static keycode key_state_array[KEY_STATE_MAX_LENGTH]; |
10 | 10 | ||
11 | void input_init(void) { | ||
12 | int i; | ||
13 | for (i = 0; i < KEY_STATE_MAX_LENGTH; ++i) { | ||
14 | key_state_array[i] = 0; | ||
15 | } | ||
16 | } | ||
17 | |||
11 | static uint8_t find_key(keycode key) { | 18 | static uint8_t find_key(keycode key) { |
12 | int i; | 19 | int i; |
13 | for (i = 0; i < KEY_STATE_MAX_LENGTH; ++i) { | 20 | for (i = 0; i < KEY_STATE_MAX_LENGTH; ++i) { |