diff options
author | Owen Taylor <otaylor@redhat.com> | 2003-05-21 17:49:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-05-21 17:49:49 +0000 |
commit | e1fb5367240780c2ceeba42dd87c9b5e253cf1b9 (patch) | |
tree | 8b6c8cc6352fd9367be489dda5d5d6c302ba25d9 /gtk/gtkkeyhash.c | |
parent | 534710deaca25f295be17b4009adc34fe7883176 (diff) | |
download | gtk+-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.c | 5 |
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; |