Reduce debounce timer + Remove magic number

This commit is contained in:
OpenSauce04 2024-07-11 19:42:20 +01:00 committed by OpenSauce
parent db09c2c9e9
commit 11b99da1e6

View File

@ -148,7 +148,7 @@ class ControllerQuickConfigDialog(
private fun onKeyEvent(event: KeyEvent): Boolean {
return when (event.action) {
KeyEvent.ACTION_UP -> {
if (System.currentTimeMillis()-debounceTimestamp < 500) {
if (System.currentTimeMillis()-debounceTimestamp < DEBOUNCE_TIMER) {
return true
}
@ -224,4 +224,8 @@ class ControllerQuickConfigDialog(
}
return true
}
companion object {
private const val DEBOUNCE_TIMER = 100
}
}