Handle KEYCODE_DPAD_CENTER and KEYCODE_ENTER (#140808)
https://github.com/flutter/flutter/issues/1670 Note: This PR replaces the the original PR (https://github.com/flutter/flutter/pull/138240) that got into a state where a rebase was not possible and made it difficult to determine what was causing unrelated test failures.
This commit is contained in:
committed by
GitHub
parent
d46a8afc1a
commit
743cdd68b7
@@ -1221,6 +1221,7 @@ class WidgetsApp extends StatefulWidget {
|
||||
SingleActivator(LogicalKeyboardKey.numpadEnter): ActivateIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.space): ActivateIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.gameButtonA): ActivateIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.select): ActivateIntent(),
|
||||
|
||||
// Dismissal
|
||||
SingleActivator(LogicalKeyboardKey.escape): DismissIntent(),
|
||||
|
||||
@@ -146,6 +146,11 @@ void main() {
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.gameButtonA);
|
||||
await tester.pumpAndSettle();
|
||||
expect(checked, isTrue);
|
||||
|
||||
checked = false;
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.select);
|
||||
await tester.pumpAndSettle();
|
||||
expect(checked, isTrue);
|
||||
// ignore: deprecated_member_use
|
||||
}, variant: KeySimulatorTransitModeVariant.all());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user