SF.net SVN: geany-plugins:[1841] trunk/geany-plugins/webhelper/src/ gwh-keybindings.c

colombanw at users.sourceforge.net colombanw at xxxxx
Thu Jan 13 21:54:37 UTC 2011


Revision: 1841
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1841&view=rev
Author:   colombanw
Date:     2011-01-13 21:54:37 +0000 (Thu, 13 Jan 2011)

Log Message:
-----------
WebHelper: Fix handling of keybindings using Shift and a letter

key-press-event signal seems to give an uppercase keyval when shift
is pressed, but Geany doesn't store this. So, lowercase the keyval when
shift modifier is on.

Modified Paths:
--------------
    trunk/geany-plugins/webhelper/src/gwh-keybindings.c

Modified: trunk/geany-plugins/webhelper/src/gwh-keybindings.c
===================================================================
--- trunk/geany-plugins/webhelper/src/gwh-keybindings.c	2011-01-13 19:41:55 UTC (rev 1840)
+++ trunk/geany-plugins/webhelper/src/gwh-keybindings.c	2011-01-13 21:54:37 UTC (rev 1841)
@@ -69,13 +69,17 @@
 {
   guint     mods = event->state & gtk_accelerator_get_default_mod_mask ();
   gboolean  handled = FALSE;
+  guint     keyval = event->keyval;
   guint     i;
   
+  if (mods & GDK_SHIFT_MASK) {
+    keyval = gdk_keyval_to_lower (keyval);
+  }
   for (i = 0; ! handled && i < GWH_KB_COUNT; i++) {
     GeanyKeyBinding *kb;
     
     kb = keybindings_get_item (G_key_group, i);
-    if (kb->key == event->keyval && kb->mods == mods) {
+    if (kb->key == keyval && kb->mods == mods) {
       if (kb->callback) {
         kb->callback (i);
       /* We can't handle key group callback since we can't acces key group


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list