aboutsummaryrefslogtreecommitdiff
path: root/hotkeythingy.c
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-18 14:57:50 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-18 14:57:50 +0530
commit97296742782f3327d13e1432c29c57e48547baa3 (patch)
tree20e391c2613305fa9d27364d34a8b7db6e15dfbf /hotkeythingy.c
parent1776f88e1510646960b0f90cbc9b71fdc84be220 (diff)
parent579f0d0af2a02a89a85ba6d70cca6e053a644055 (diff)
downloadshotkey-97296742782f3327d13e1432c29c57e48547baa3.tar.gz
shotkey-97296742782f3327d13e1432c29c57e48547baa3.zip
Merge branch 'master' into personal
Diffstat (limited to 'hotkeythingy.c')
-rw-r--r--hotkeythingy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hotkeythingy.c b/hotkeythingy.c
index 922931a..dcbcc08 100644
--- a/hotkeythingy.c
+++ b/hotkeythingy.c
@@ -124,8 +124,8 @@ void keypress(Display *dpy, Window win, XKeyEvent *ev) {
}
}
} else {
- // Escape key
- is_mode_persistent = is_mode_persistent && ev->keycode != 9;
+ // Will quit if the key pressed is not defined in the mode
+ is_mode_persistent = False;
if (modes[current_mode] && current_mode < LENGTH(modes)) {
// Check if key is in mode and execute
@@ -133,6 +133,8 @@ void keypress(Display *dpy, Window win, XKeyEvent *ev) {
mode_key = modes[current_mode][i];
if (keysym == mode_key.key && CLEANMASK(mode_key.mod) == CLEANMASK(ev->state)) {
+ // Action taken so keep the mode alive
+ is_mode_persistent = True;
run(dpy, win, mode_key.command);
}
}