commit: 2425cad5171932d32b96752fc15c608ab3944227
parent: b93b710b012f65adf2dd3c2e0f809b8f0ee070f8
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 21 Jun 2019 00:00:05 +0200
Add Alt-n tab switching
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/badwolf.1 b/badwolf.1
@@ -42,6 +42,8 @@ Go back/forward in current tab’s history
Go to the previous/next tab
.It any F1
Shows the about dialog
+.It any Alt-n
+Where n is any numeric-row key. Go to the n-th tab, 0 goes to the last one.
.El
.Ss DEFAULT ONES
Here is a incomplete list of the default Webkit/GTK keybindings:
diff --git a/badwolf.c b/badwolf.c
@@ -213,13 +213,16 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
}
}
- if((((GdkEventKey *)event)->state & GDK_MOD1_MASK) && browser != NULL)
+ if((((GdkEventKey *)event)->state & GDK_MOD1_MASK))
{
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((((GdkEventKey *)event)->keyval >= GDK_KEY_0) &&
+ (((GdkEventKey *)event)->keyval <= GDK_KEY_9))
+ gtk_notebook_set_current_page(notebook, (((GdkEventKey *)event)->keyval - GDK_KEY_1));
}
if(browser != NULL)