fix: dpad long-press

This commit is contained in:
edde746
2026-01-23 20:24:20 +01:00
parent 3a2f2c9c69
commit efe9b86707
6 changed files with 182 additions and 56 deletions
+20
View File
@@ -57,3 +57,23 @@ extension DpadKeyExtension on LogicalKeyboardKey {
/// Whether this key moves focus down.
bool get isDownKey => this == LogicalKeyboardKey.arrowDown;
}
/// Global helper to suppress the next SELECT key-up event.
class SelectKeyUpSuppressor {
static bool _suppressSelectUntilKeyUp = false;
static void suppressSelectUntilKeyUp() {
_suppressSelectUntilKeyUp = true;
}
static bool consumeIfSuppressed(KeyEvent event) {
if (!_suppressSelectUntilKeyUp) return false;
if (event.logicalKey.isSelectKey) {
if (event is KeyUpEvent) {
_suppressSelectUntilKeyUp = false;
}
return true;
}
return false;
}
}