commit: 30a0219b792593e0c6a51d9659041ce9fcc005e8
parent 459d50c30cd1b14946ed16267b8417625d6246a9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 27 Apr 2019 19:38:13 +0200
badwolf.c: Add Alt+{Left,Right} for history, Add F5
Diffstat:
1 file changed, 26 insertions(+), 0 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -93,6 +93,15 @@ WebViewCb_close(WebKitWebView *webView, gpointer user_data)
return TRUE;
}
+/* commonCb_key_press_event: Global callback for keybindings
+ *
+ * Theses shortcuts should be avoided as much as possible:
+ * - Single key shortcuts (ie. backspace and space)
+ * - Triple key shortcuts (except for Ctrl+Shift)
+ * - Unix Terminal shortcuts (specially Ctrl-W)
+ *
+ * loosely follows https://developer.gnome.org/hig/stable/keyboard-input.html
+ */
static gboolean
commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *browser)
{
@@ -129,6 +138,23 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
}
}
}
+ if((((GdkEventKey *)event)->state & GDK_MOD1_MASK) && brower != NULL)
+ )
+ {
+ switch(((GdkEventKey *)event)->keyval)
+ {
+ case GDK_KEY_Left: gtk_notebook_prev_page(notebook); return TRUE;
+ case GDK_KEY_Right: gtk_notebook_next_page(notebook); return TRUE;
+ }
+ }
+
+ if(browser != NULL)
+ {
+ switch(((GdkEventKey *)event)->keyval)
+ {
+ case GDK_KEY_F5: webkit_web_view_reload(browser->webView); return TRUE;
+ }
+ }
return FALSE;
}