Allow to go back to normal mode via ctrl-c too.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 19 Nov 2012 19:45:07 +0000 (20:45 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 19 Nov 2012 19:45:07 +0000 (20:45 +0100)
src/keybind.c
src/keybind.h

index fc87bd9..4f2cef3 100644 (file)
@@ -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, ""};
index ef9db09..7dab1ee 100644 (file)
@@ -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 <gdk/gdkkeysyms.h>
 #include <gdk/gdkkeysyms-compat.h>