From 1752e8f33dfa418dc392d0b4f4069524d488fed3 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 19 Nov 2012 20:45:07 +0100 Subject: [PATCH] Allow to go back to normal mode via ctrl-c too. --- src/keybind.c | 2 +- src/keybind.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/keybind.c b/src/keybind.c index fc87bd9..4f2cef3 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -205,7 +205,7 @@ static gboolean keybind_keypress_callback(WebKitWebView* webview, GdkEventKey* e guint state = (event->state & modifiers); /* check for escape or modkeys or counts */ - if (keyval == GDK_Escape && state == 0) { + if (IS_ESCAPE_KEY(keyval, state)) { completion_clean(); /* switch to normal mode and clear the input box */ Arg a = {VP_MODE_NORMAL, ""}; diff --git a/src/keybind.h b/src/keybind.h index ef9db09..7dab1ee 100644 --- a/src/keybind.h +++ b/src/keybind.h @@ -20,6 +20,8 @@ #ifndef KEYBIND_H #define KEYBIND_H +#define IS_ESCAPE_KEY(k, s) ((k == GDK_Escape && s == 0) || (k == GDK_c && s == GDK_CONTROL_MASK)) + #include #include -- 2.20.1