Browse Source

Allow disabling autorepeat for bugged-out inputs.

Ian Walton 3 years ago
parent
commit
b37f1ff539
2 changed files with 6 additions and 1 deletions
  1. 4 0
      resources/settings/settings_description.json
  2. 2 1
      src/input/InputComponent.cpp

+ 4 - 0
resources/settings/settings_description.json

@@ -119,6 +119,10 @@
       {
         "value": "checkForUpdates",
         "default": true
+      },
+      {
+        "value": "enableInputRepeat",
+        "default": true
       }
     ]
   },

+ 2 - 1
src/input/InputComponent.cpp

@@ -219,7 +219,8 @@ void InputComponent::remapInput(const QString &source, const QString &keycode, I
     }
   }
 
-  if (!m_autoRepeatActions.isEmpty() && keyState != InputBase::KeyPressed)
+  if (!m_autoRepeatActions.isEmpty() && keyState != InputBase::KeyPressed
+      && SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "enableInputRepeat").toBool())
     m_autoRepeatTimer->start(INITAL_AUTOREPEAT_MSEC);
 
   if (!queuedActions.isEmpty())