Don't enable numlock by default. This fixes an annoying issue where laptop keyboards would have 'numlock mode' enabled, remapping parts of the alphabet to numbers.

This commit is contained in:
Geoff Greer 2018-07-27 22:42:50 -07:00
parent 53069f1403
commit 30fee94354
2 changed files with 2 additions and 2 deletions

View file

@ -387,7 +387,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap);
xkb_mod_mask_t locked_mods = 0; xkb_mod_mask_t locked_mods = 0;
if (!input_config || input_config->xkb_numlock != 0) { if (input_config && input_config->xkb_numlock > 0) {
xkb_mod_index_t mod_index = xkb_map_mod_get_index(keymap, XKB_MOD_NAME_NUM); xkb_mod_index_t mod_index = xkb_map_mod_get_index(keymap, XKB_MOD_NAME_NUM);
if (mod_index != XKB_MOD_INVALID) { if (mod_index != XKB_MOD_INVALID) {
locked_mods |= (uint32_t)1 << mod_index; locked_mods |= (uint32_t)1 << mod_index;

View file

@ -39,7 +39,7 @@ The following commands may only be used in the configuration file.
Initially enables or disables CapsLock, the default is disabled. Initially enables or disables CapsLock, the default is disabled.
*input* <identifier> xkb\_numlock enabled|disabled *input* <identifier> xkb\_numlock enabled|disabled
Initially enables or disables NumLock, the default is enabled. Initially enables or disables NumLock, the default is disabled.
## MAPPING CONFIGURATION ## MAPPING CONFIGURATION