diff options
badwolf.c: Add Alt+{Left,Right} for history, Add F5
1 files changed, 26 insertions, 0 deletions
| -rw-r--r-- | badwolf.c | 26 |
@@ -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; } |