aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-12-22 15:07:27 +0100
committerMarc André Tanner <mat@brain-dump.org>2014-12-23 13:24:07 +0100
commitd47c31e12e0e2aa691b861a0da884f785664ba36 (patch)
treeaebfbbd46943dc0805697e03f16c49bc786d6102 /vis.c
parentb8456fa2615480fa242c6992ca89481a8370fe5f (diff)
downloadvis-d47c31e12e0e2aa691b861a0da884f785664ba36.tar.gz
vis-d47c31e12e0e2aa691b861a0da884f785664ba36.tar.xz
Move kepress hook to record all keys
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vis.c b/vis.c
index 6015fcb..e9eb7c8 100644
--- a/vis.c
+++ b/vis.c
@@ -1732,8 +1732,6 @@ static void keypress(Key *key) {
static KeyCombo keys;
static int keylen;
- if (config->keypress && !config->keypress(key))
- return;
keys[keylen++] = *key;
KeyBinding *action = keybinding(mode, keys);
@@ -1759,7 +1757,7 @@ static void keypress(Key *key) {
}
static Key getkey(void) {
- Key key = { .str = "\0\0\0\0\0\0", .code = 0 };
+ Key key = { .str = "", .code = 0 };
int keycode = getch(), len = 0;
if (keycode == ERR)
return key;
@@ -1778,6 +1776,9 @@ static Key getkey(void) {
}
}
+ if (config->keypress && !config->keypress(&key))
+ return (Key){ .str = "", .code = 0 };
+
return key;
}