keybindings: Hardcode Mod2Mask for Num Lock

This is actually part of the XKB specification, so we don't need to look
for it at runtime.
This commit is contained in:
Jasper St. Pierre 2014-08-15 16:22:16 -04:00
parent 517e8f6fbd
commit fb6438cdd4

View File

@ -207,7 +207,6 @@ reload_modmap (MetaKeyBindingManager *keys)
XModifierKeymap *modmap; XModifierKeymap *modmap;
int map_size; int map_size;
int i; int i;
int num_lock_mask = 0;
int scroll_lock_mask = 0; int scroll_lock_mask = 0;
modmap = XGetModifierMapping (keys->xdisplay); modmap = XGetModifierMapping (keys->xdisplay);
@ -247,16 +246,7 @@ reload_modmap (MetaKeyBindingManager *keys)
(1 << ( i / modmap->max_keypermod))); (1 << ( i / modmap->max_keypermod)));
} }
if (syms[j] == XKB_KEY_Num_Lock) if (syms[j] == XKB_KEY_Scroll_Lock)
{
/* Mod1Mask is 1 << 3 for example, i.e. the
* fourth modifier, i / keyspermod is the modifier
* index
*/
num_lock_mask |= (1 << ( i / modmap->max_keypermod));
}
else if (syms[j] == XKB_KEY_Scroll_Lock)
{ {
scroll_lock_mask |= (1 << ( i / modmap->max_keypermod)); scroll_lock_mask |= (1 << ( i / modmap->max_keypermod));
} }
@ -283,14 +273,11 @@ reload_modmap (MetaKeyBindingManager *keys)
++i; ++i;
} }
keys->ignored_modifier_mask = (num_lock_mask | keys->ignored_modifier_mask = (scroll_lock_mask | Mod2Mask | LockMask);
scroll_lock_mask |
LockMask);
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Ignoring modmask 0x%x num lock 0x%x scroll lock 0x%x hyper 0x%x super 0x%x meta 0x%x\n", "Ignoring modmask 0x%x scroll lock 0x%x hyper 0x%x super 0x%x meta 0x%x\n",
keys->ignored_modifier_mask, keys->ignored_modifier_mask,
num_lock_mask,
scroll_lock_mask, scroll_lock_mask,
keys->hyper_mask, keys->hyper_mask,
keys->super_mask, keys->super_mask,