Branch: refs/heads/master Author: Vasiliy Faronov vfaronov@gmail.com Committer: Frank Lanitz frank@frank.uvena.de Date: Wed, 15 Feb 2017 21:37:20 UTC Commit: d13b29593af63dc5dd84d08de1f41ff744420eeb https://github.com/geany/geany-plugins/commit/d13b29593af63dc5dd84d08de1f41f...
Log Message: ----------- TreeBrowser: pop up context menu on Shift+F10 (#523)
GTK+ by default maps Shift+F10 to the same thing as Menu, which is useful for laptop keyboards (that have no Menu key). But because TreeBrowser handles keypresses on its own, it doesn't get this functionality automatically.
Implementation is per the "Test for modifier keys correctly" section of the GTK+ reference manual.
Modified Paths: -------------- treebrowser/src/treebrowser.c
Modified: treebrowser/src/treebrowser.c 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -1427,6 +1427,7 @@ on_treeview_keypress(GtkWidget *widget, GdkEventKey *event) GtkTreeIter iter; GtkTreeModel *model; GtkTreePath *path; + GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask();
if (event->keyval == GDK_space) { @@ -1445,7 +1446,8 @@ on_treeview_keypress(GtkWidget *widget, GdkEventKey *event) on_button_go_up(); return TRUE; } - if (event->keyval == GDK_Menu) + if ((event->keyval == GDK_Menu) || + (event->keyval == GDK_F10 && (event->state & modifiers) == GDK_SHIFT_MASK)) { gchar *name = NULL, *uri = NULL; GtkWidget *menu;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).