aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 17:14:26 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 17:14:46 -0400
commit3a5fce339f8dcc22db8cafdfeba7b2748df02d18 (patch)
treecc8e636cb46b901b782c9bb38bdaa405ae2a8964 /sway
parentMerge pull request #104 from minus7/ipc-get-messages (diff)
downloadsway-3a5fce339f8dcc22db8cafdfeba7b2748df02d18.tar.gz
sway-3a5fce339f8dcc22db8cafdfeba7b2748df02d18.tar.zst
sway-3a5fce339f8dcc22db8cafdfeba7b2748df02d18.zip
Reset key buffer on reload
To preserve my sanity
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c3
-rw-r--r--sway/input_state.c7
2 files changed, 10 insertions, 0 deletions
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
13struct sway_config *config; 14struct sway_config *config;
14 15
@@ -147,6 +148,8 @@ _continue:
147bool load_config(const char *file) { 148bool 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
9static keycode key_state_array[KEY_STATE_MAX_LENGTH]; 9static keycode key_state_array[KEY_STATE_MAX_LENGTH];
10 10
11void 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
11static uint8_t find_key(keycode key) { 18static 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) {