Author: post
Date: 2011-03-16 19:22:02 +0100 (Wed, 16 Mar 2011)
New Revision: 3886
Modified:
trunk/src/gtk-helper.c
Log:
Also have keypad "0" work as shortcut.
Modified: trunk/src/gtk-helper.c
===================================================================
--- trunk/src/gtk-helper.c 2011-03-16 18:08:17 UTC (rev 3885)
+++ trunk/src/gtk-helper.c 2011-03-16 18:22:02 UTC (rev 3886)
@@ -315,17 +315,20 @@
{
GdkEventKey *out = g_memdup(in, sizeof(GdkEventKey));
+ static guint zero_keyval = 0;
static guint one_keyval = 0;
+ static guint zero_hardware = 0;
static guint one_hardware = 0;
if (!one_keyval)
{
- one_keyval = gdk_keyval_from_name("1");
GdkKeymapKey *keys;
gint n_keys;
+ zero_keyval = gdk_keyval_from_name("0");
+ if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
zero_keyval, &keys, &n_keys))
+ zero_hardware = keys[0].keycode;
+ one_keyval = gdk_keyval_from_name("1");
if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
one_keyval, &keys, &n_keys))
- {
one_hardware = keys[0].keycode;
- }
}
/* Replace 'Num-*' with '*' */
@@ -341,6 +344,12 @@
out->hardware_keycode = one_hardware+(in->keyval-65457);
}
+ /* Replace Numpad 0 with ordinary numbers */
+ if (in->keyval == 65456)
+ {
+ out->keyval = zero_keyval;
+ out->hardware_keycode = zero_hardware;
+ }
return out;
}
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit