aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2020-08-31 14:21:24 +0100
committerHarry Jeffery <harry@exec64.co.uk>2020-08-31 14:21:24 +0100
commit0131ab6f97a6ea82d3c87c7b59646dcf9a8d68fa (patch)
treeb48634f3406947283c8ad9d3d9a45bbf1db6af5e
parent90cc7adbd2fbe4f9f3bc2682c92024baf85a6abb (diff)
downloadimv-0131ab6f97a6ea82d3c87c7b59646dcf9a8d68fa.tar.gz
Fix bug handling multi-key binds
-rw-r--r--src/imv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/imv.c b/src/imv.c
index a451839..100fac3 100644
--- a/src/imv.c
+++ b/src/imv.c
@@ -415,9 +415,14 @@ static void key_handler(struct imv *imv, const struct imv_event *event)
return;
}
- struct list *cmds = imv_bind_handle_event(imv->binds, event->data.keyboard.description);
- if (cmds) {
- imv_command_exec_list(imv->commands, cmds, imv);
+ /* Keys such as Shift on their own come through as '', we should skip them
+ * since they'll turn up later as 'Shift+W', etc.
+ */
+ if (*event->data.keyboard.description != '\0') {
+ struct list *cmds = imv_bind_handle_event(imv->binds, event->data.keyboard.description);
+ if (cmds) {
+ imv_command_exec_list(imv->commands, cmds, imv);
+ }
}
}