From 4a25ce928fa691a354d96990e037e397938efe95 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Sun, 3 Sep 2023 14:11:01 -0700 Subject: [PATCH] IME press tab, keyboard SHIFT+ALT+UP, SHIFT+ALT+DOWN, and defaultTargetPlatform configuration of key press platform value (Resolves #8)(Resolves #9)(Resolves #12) (#13) --- lib/src/input_method_engine.dart | 8 + lib/src/keyboard.dart | 481 +++++++++++++++++-------------- 2 files changed, 270 insertions(+), 219 deletions(-) diff --git a/lib/src/input_method_engine.dart b/lib/src/input_method_engine.dart index ae8931e..eeebbcf 100644 --- a/lib/src/input_method_engine.dart +++ b/lib/src/input_method_engine.dart @@ -96,6 +96,14 @@ class ImeSimulator { await _tester.pumpAndSettle(); } + /// Simulates the user pressing the tab button on a software keyboard. + Future pressTab({ + Finder? finder, + GetDeltaTextInputClient? getter, + }) async { + await typeText('\t'); + } + /// Simulates the user pressing the backspace button. /// /// If the selection is collapsed, the upstream character is deleted. If the selection is expanded, then diff --git a/lib/src/keyboard.dart b/lib/src/keyboard.dart index 554ea32..443f760 100644 --- a/lib/src/keyboard.dart +++ b/lib/src/keyboard.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -28,18 +29,18 @@ extension KeyboardInput on WidgetTester { final keyCombo = _keyComboForCharacter(character); if (keyCombo.isShiftPressed) { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); } if (keyCombo.isShiftPressed) { - await sendKeyDownEvent(keyCombo.physicalKey!, platform: 'macos', character: character); - await sendKeyUpEvent(keyCombo.physicalKey!, platform: 'macos'); + await sendKeyDownEvent(keyCombo.physicalKey!, platform: _keyEventPlatform, character: character); + await sendKeyUpEvent(keyCombo.physicalKey!, platform: _keyEventPlatform); } else { - await sendKeyEvent(keyCombo.key, platform: 'macos'); + await sendKeyEvent(keyCombo.key, platform: _keyEventPlatform); } if (keyCombo.isShiftPressed) { - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); } await pump(); @@ -47,452 +48,494 @@ extension KeyboardInput on WidgetTester { } Future pressEnter() async { - await sendKeyEvent(LogicalKeyboardKey.enter, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftEnter() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdEnter() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlEnter() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.enter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressNumpadEnter() async { - await sendKeyEvent(LogicalKeyboardKey.numpadEnter, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.numpadEnter, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftNumpadEnter() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.numpadEnter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.numpadEnter, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.numpadEnter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.numpadEnter, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressTab() async { - await sendKeyEvent(LogicalKeyboardKey.tab, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.tab, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressBackspace() async { - await sendKeyEvent(LogicalKeyboardKey.backspace, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdBackspace() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressAltBackspace() async { - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlBackspace() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.backspace, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressDelete() async { - await sendKeyEvent(LogicalKeyboardKey.delete, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.delete, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdB() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyB, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyB, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyB, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyB, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlB() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyB, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyB, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyB, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyB, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdC() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyC, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyC, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyC, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyC, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlC() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyC, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyC, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyC, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyC, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdI() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyI, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyI, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyI, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyI, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlI() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyI, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyI, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyI, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyI, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdX() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyX, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyX, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyX, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyX, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlX() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyX, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyX, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyX, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyX, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdV() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyV, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyV, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyV, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyV, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlV() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyV, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyV, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyV, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyV, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdA() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyA, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyA, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyA, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyA, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlA() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyA, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyA, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyA, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyA, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlE() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.keyE, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.keyE, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.keyE, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.keyE, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressHome() async { - await sendKeyDownEvent(LogicalKeyboardKey.home, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.home, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressEnd() async { - await sendKeyDownEvent(LogicalKeyboardKey.end, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.end, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressLeftArrow() async { - await sendKeyEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressAltLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftAltLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCtlLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCmdLeftArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowLeft, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressRightArrow() async { - await sendKeyEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressAltRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftAltRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCtlRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCtlRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCmdRightArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowRight, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressUpArrow() async { - await sendKeyEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftUpArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdUpArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCmdUpArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressAltUpArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await pumpAndSettle(); + } + + Future pressShiftAltUpArrow() async { + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowUp, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressDownArrow() async { - await sendKeyEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftDownArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdDownArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressShiftCmdDownArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressAltDownArrow() async { - await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: 'macos'); - await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: 'macos'); - await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: 'macos'); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await pumpAndSettle(); + } + + Future pressShiftAltDownArrow() async { + await sendKeyDownEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.arrowDown, platform: _keyEventPlatform); + await sendKeyDownEvent(LogicalKeyboardKey.alt, platform: _keyEventPlatform); + await sendKeyUpEvent(LogicalKeyboardKey.shift, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressEscape() async { - await sendKeyEvent(LogicalKeyboardKey.escape, platform: 'macos'); + await sendKeyEvent(LogicalKeyboardKey.escape, platform: _keyEventPlatform); await pumpAndSettle(); } Future pressCmdHome(WidgetTester tester) async { - await tester.sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await tester.sendKeyDownEvent(LogicalKeyboardKey.home, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.home, platform: 'macos'); + await tester.sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await tester.sendKeyDownEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); await tester.pumpAndSettle(); } Future pressCmdEnd(WidgetTester tester) async { - await tester.sendKeyDownEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await tester.sendKeyDownEvent(LogicalKeyboardKey.end, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.meta, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.end, platform: 'macos'); + await tester.sendKeyDownEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await tester.sendKeyDownEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.meta, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); await tester.pumpAndSettle(); } Future pressCtrlHome(WidgetTester tester) async { - await tester.sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await tester.sendKeyDownEvent(LogicalKeyboardKey.home, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.home, platform: 'macos'); + await tester.sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await tester.sendKeyDownEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.home, platform: _keyEventPlatform); await tester.pumpAndSettle(); } Future pressCtrlEnd(WidgetTester tester) async { - await tester.sendKeyDownEvent(LogicalKeyboardKey.control, platform: 'macos'); - await tester.sendKeyDownEvent(LogicalKeyboardKey.end, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.control, platform: 'macos'); - await tester.sendKeyUpEvent(LogicalKeyboardKey.end, platform: 'macos'); + await tester.sendKeyDownEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await tester.sendKeyDownEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.control, platform: _keyEventPlatform); + await tester.sendKeyUpEvent(LogicalKeyboardKey.end, platform: _keyEventPlatform); await tester.pumpAndSettle(); } } +String get _keyEventPlatform { + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return "android"; + case TargetPlatform.iOS: + return "ios"; + case TargetPlatform.macOS: + return "macos"; + case TargetPlatform.windows: + return "windows"; + case TargetPlatform.fuchsia: + case TargetPlatform.linux: + return "linux"; + } +} + +/// Override for the `platform` value that's passed to every key simulation event. +/// +/// When `null`, Flutter's `defaultTargetPlatform` determines the `platform` value +/// that's passed to every key simulation event. +String? keyEventPlatformOverride; + /// Returns a physical keyboard key combination that expects to create the /// given [character]. _KeyCombo _keyComboForCharacter(String character) {