From 225e13c3cc83308175f0a9aa18cfa31324155034 Mon Sep 17 00:00:00 2001 From: nyx Date: Wed, 16 Apr 2025 20:19:10 -0400 Subject: InputManager: add config option to disable keybinds per device (#10064) --- src/managers/input/InputManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 0665e0d2..af84eb20 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1022,10 +1022,12 @@ void CInputManager::applyConfigToKeyboard(SP pKeyboard) { const auto VARIANT = g_pConfigManager->getDeviceString(devname, "kb_variant", "input:kb_variant"); const auto OPTIONS = g_pConfigManager->getDeviceString(devname, "kb_options", "input:kb_options"); - const auto ENABLED = HASCONFIG ? g_pConfigManager->getDeviceInt(devname, "enabled") : true; + const auto ENABLED = HASCONFIG ? g_pConfigManager->getDeviceInt(devname, "enabled") : true; + const auto ALLOWBINDS = HASCONFIG ? g_pConfigManager->getDeviceInt(devname, "keybinds") : true; pKeyboard->enabled = ENABLED; pKeyboard->resolveBindsBySym = RESOLVEBINDSBYSYM; + pKeyboard->allowBinds = ALLOWBINDS; try { if (NUMLOCKON == pKeyboard->numlockOn && REPEATDELAY == pKeyboard->repeatDelay && REPEATRATE == pKeyboard->repeatRate && RULES != "" && @@ -1538,6 +1540,9 @@ uint32_t CInputManager::accumulateModsFromAllKBs() { if (!kb->enabled) continue; + if (!kb->allowBinds) + continue; + finalMask |= kb->getModifiers(); } -- cgit v1.2.3