diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-12-22 15:07:27 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-12-23 13:24:07 +0100 |
| commit | d47c31e12e0e2aa691b861a0da884f785664ba36 (patch) | |
| tree | aebfbbd46943dc0805697e03f16c49bc786d6102 /vis.c | |
| parent | b8456fa2615480fa242c6992ca89481a8370fe5f (diff) | |
| download | vis-d47c31e12e0e2aa691b861a0da884f785664ba36.tar.gz vis-d47c31e12e0e2aa691b861a0da884f785664ba36.tar.xz | |
Move kepress hook to record all keys
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |
