From c0645c393b317e419c668e8c19c754488415f85b Mon Sep 17 00:00:00 2001 From: Sixels Date: Tue, 19 Apr 2022 13:51:00 -0300 Subject: [PATCH] Set keyboard repeat rate and delay from config --- src/managers/InputManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index 43b4ec12..4d2c7b10 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -206,10 +206,13 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) { const auto CONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS); const auto KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); + const auto REPEATRATE = g_pConfigManager->getInt("input:repeat_rate"); + const auto REPEATDELAY = g_pConfigManager->getInt("input:repeat_delay"); + wlr_keyboard_set_keymap(keyboard->keyboard, KEYMAP); xkb_keymap_unref(KEYMAP); xkb_context_unref(CONTEXT); - wlr_keyboard_set_repeat_info(keyboard->keyboard, 25, 600); + wlr_keyboard_set_repeat_info(keyboard->keyboard, REPEATRATE, REPEATDELAY); PNEWKEYBOARD->hyprListener_keyboardMod.initCallback(&keyboard->keyboard->events.modifiers, &Events::listener_keyboardMod, PNEWKEYBOARD, "Keyboard"); PNEWKEYBOARD->hyprListener_keyboardKey.initCallback(&keyboard->keyboard->events.key, &Events::listener_keyboardKey, PNEWKEYBOARD, "Keyboard");