summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/InputManager.cpp')
-rw-r--r--src/managers/InputManager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index e27e82ce..d206cd7d 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -289,6 +289,20 @@ void CInputManager::setKeyboardLayout() {
for (auto& k : m_lKeyboards)
wlr_keyboard_set_keymap(k.keyboard->keyboard, KEYMAP);
+ wlr_keyboard_modifiers wlrMods = {0};
+
+ if (g_pConfigManager->getInt("input:numlock_by_default") == 1) {
+ // lock numlock
+ const auto IDX = xkb_map_mod_get_index(KEYMAP, XKB_MOD_NAME_NUM);
+
+ if (IDX != XKB_MOD_INVALID)
+ wlrMods.locked |= (uint32_t)1 << IDX;
+ }
+
+ if (wlrMods.locked != 0) {
+ wlr_seat_keyboard_notify_modifiers(g_pCompositor->m_sSeat.seat, &wlrMods);
+ }
+
xkb_keymap_unref(KEYMAP);
xkb_context_unref(CONTEXT);