main: Ignore some modifiers when matching events to keybindings

Some modifiers like NumLock or ScrollLock don't make sense in
keybindings, which is why we ignore them in mutter when matching
events to keybindings; for keybindings in the overview, we do
the matching ourselves, so filter the same modifiers as mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=665215
This commit is contained in:
Florian Müllner 2012-03-13 16:25:50 +01:00
parent 2fad9d73d4
commit 93a004b016

View File

@ -586,7 +586,8 @@ function _globalKeyPressHandler(actor, event) {
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
let keyCode = event.get_key_code(); let keyCode = event.get_key_code();
let modifierState = event.get_state(); let ignoredModifiers = global.display.get_ignored_modifier_mask();
let modifierState = event.get_state() & ~ignoredModifiers;
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType // This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
let action = global.display.get_keybinding_action(keyCode, modifierState); let action = global.display.get_keybinding_action(keyCode, modifierState);