refactor: fix warnings

This commit is contained in:
edde746
2025-12-13 15:37:55 +01:00
parent 18c322f66a
commit 867992e96b
23 changed files with 141 additions and 172 deletions
-8
View File
@@ -56,7 +56,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
_updateFocusHighlightStrategy(_mode);
// Listen to hardware keyboard events globally
HardwareKeyboard.instance.addHandler(_handleKeyEvent);
RawKeyboard.instance.addListener(_handleRawKeyEvent);
// Register callback for gamepad input to switch to keyboard mode
GamepadService.onGamepadInput = () => _setMode(InputMode.keyboard);
@@ -65,7 +64,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
@override
void dispose() {
HardwareKeyboard.instance.removeHandler(_handleKeyEvent);
RawKeyboard.instance.removeListener(_handleRawKeyEvent);
GamepadService.onGamepadInput = null;
super.dispose();
}
@@ -79,12 +77,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
return false;
}
void _handleRawKeyEvent(RawKeyEvent event) {
if (event is RawKeyDownEvent) {
_setMode(InputMode.keyboard);
}
}
void _setMode(InputMode mode) {
if (_mode != mode) {
setState(() => _mode = mode);