Open Search with Alt slash shortcut
Accept the physical slash key for exact Alt+/ delivery, including macOS Option dead-key values, while preserving existing Ctrl+/ and Command+/ behavior. Add focused regression coverage and document the verified checks.
This commit is contained in:
@@ -75,6 +75,27 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
test('Alt+/ uses the physical slash key for Option dead-key delivery', () {
|
||||
const event = KeyDownEvent(
|
||||
physicalKey: PhysicalKeyboardKey.slash,
|
||||
logicalKey: LogicalKeyboardKey(0x00BF),
|
||||
character: '¿',
|
||||
timeStamp: Duration.zero,
|
||||
);
|
||||
expect(shellSearchShortcut(event, _AltHeld()), isTrue);
|
||||
expect(
|
||||
shellSearchShortcut(
|
||||
const KeyUpEvent(
|
||||
physicalKey: PhysicalKeyboardKey.slash,
|
||||
logicalKey: LogicalKeyboardKey(0x00BF),
|
||||
timeStamp: Duration.zero,
|
||||
),
|
||||
_AltHeld(),
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
for (final platform in [TargetPlatform.macOS, TargetPlatform.windows]) {
|
||||
testWidgets(
|
||||
'Search chord opens and refocuses retained query on $platform',
|
||||
@@ -130,3 +151,14 @@ void main() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AltHeld extends HardwareKeyboard {
|
||||
@override
|
||||
bool get isAltPressed => true;
|
||||
@override
|
||||
bool get isControlPressed => false;
|
||||
@override
|
||||
bool get isMetaPressed => false;
|
||||
@override
|
||||
bool get isShiftPressed => false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user