summaryrefslogtreecommitdiff
path: root/gtk/gtkkeyhash.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-05-21 17:49:49 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-05-21 17:49:49 +0000
commite1fb5367240780c2ceeba42dd87c9b5e253cf1b9 (patch)
tree8b6c8cc6352fd9367be489dda5d5d6c302ba25d9 /gtk/gtkkeyhash.c
parent534710deaca25f295be17b4009adc34fe7883176 (diff)
downloadgtk+-e1fb5367240780c2ceeba42dd87c9b5e253cf1b9.tar.gz
We need to pass the unmasked state to
Wed May 21 12:52:01 2003 Owen Taylor <otaylor@redhat.com> * gtk/gtkkeyhash.[ch] (_gtk_key_hash_looku): We need to pass the unmasked state to gdk_keymap_translate_keyboard_state() to handle the case where a modifier not in the mask (like Num_Lock) changes the key value, so replace the masked state with a state/mask pair. (#106913, Olivier Ripoll) * gtk/gtkwindow.c gtk/gtkbinding.c: Update to pass in state/mask pair to _gtk_key_hash_lookup()
Diffstat (limited to 'gtk/gtkkeyhash.c')
-rw-r--r--gtk/gtkkeyhash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkkeyhash.c b/gtk/gtkkeyhash.c
index 659461c19f..604c9ccd7b 100644
--- a/gtk/gtkkeyhash.c
+++ b/gtk/gtkkeyhash.c
@@ -307,6 +307,8 @@ sort_lookup_results (GSList *slist)
* @key_hash: a #GtkKeyHash
* @hardware_keycode: hardware keycode field from a #GdkEventKey
* @state: state field from a #GdkEventKey
+ * @mask: mask of modifiers to consider when matching against the
+ * modifiers in entries.
* @group: group field from a #GdkEventKey
*
* Looks up the best matching entry or entries in the hash table for
@@ -322,6 +324,7 @@ GSList *
_gtk_key_hash_lookup (GtkKeyHash *key_hash,
guint16 hardware_keycode,
GdkModifierType state,
+ GdkModifierType mask,
gint group)
{
GHashTable *keycode_hash = key_hash_get_keycode_hash (key_hash);
@@ -349,7 +352,7 @@ _gtk_key_hash_lookup (GtkKeyHash *key_hash,
{
GtkKeyHashEntry *entry = tmp_list->data;
- if ((entry->modifiers & ~consumed_modifiers) == (state & ~consumed_modifiers))
+ if ((entry->modifiers & ~consumed_modifiers & mask) == (state & ~consumed_modifiers & mask))
{
gint i;