Open annieappflowy opened 1 year ago
What key combination do we want for this?
We can implement the same as Google Docs if it's the most common key binding https://support.google.com/docs/answer/179738?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cmac-shortcuts
@annieappflowy @LucasXu0 currently we have shortcuts where we can only use one character (A-z, 1-9) and multiple modifiers (shift, alt, cmd, ctrl, option). The shortcuts suggested by Annie require listening for two characters such as next heading by Ctrl+n+[1-6]
here n is also identified as LogicalKeyboardKey.keyN
and 1 is identified as LogicalKeyboardKey.key1
.
These kinds of shortcuts with multiple keys are called shortcuts with chords(at least in VS Code). So my question is should we:
I personally think, we should just use different shortcuts as it will be the most easy thing to do. But is 'supporting shortcuts with chords' a feature that AppFlowy is looking to achieve?
Ideally we should follow the convention. @LucasXu0 , please evaluate
Enable support for shortcuts with chords.
I prefer to this solution. We can refer to the design of [Shortcuts](https://docs.flutter.dev/ui/advanced/actions-and-shortcuts)
widget to support 'chords'.
flutter: RawKeyDownEvent#57fa0(logicalKey: LogicalKeyboardKey#e3a44(keyId: "0x200000106", keyLabel: "Meta Left", debugName: "Meta Left"), physicalKey: PhysicalKeyboardKey#f2ed2(usbHidUsage: "0x000700e3", debugName: "Meta Left"), repeat: false)
flutter: RawKeyDownEvent#c0f19(logicalKey: LogicalKeyboardKey#378ce(keyId: "0x0000006e", keyLabel: "N", debugName: "Key N"), physicalKey: PhysicalKeyboardKey#a0260(usbHidUsage: "0x00070011", debugName: "Key N"), repeat: false)
flutter: RawKeyDownEvent#8a483(logicalKey: LogicalKeyboardKey#378ce(keyId: "0x0000006e", keyLabel: "N", debugName: "Key N"), physicalKey: PhysicalKeyboardKey#a0260(usbHidUsage: "0x00070011", debugName: "Key N"), repeat: true)
flutter: RawKeyDownEvent#925be(logicalKey: LogicalKeyboardKey#93474(keyId: "0x00000034", keyLabel: "4", debugName: "Digit 4"), physicalKey: PhysicalKeyboardKey#cd770(usbHidUsage: "0x00070021", debugName: "Digit 4"), repeat: false)
flutter: RawKeyUpEvent#5a495(logicalKey: LogicalKeyboardKey#93474(keyId: "0x00000034", keyLabel: "4", debugName: "Digit 4"), physicalKey: PhysicalKeyboardKey#cd770(usbHidUsage: "0x00070021", debugName: "Digit 4"))
flutter: RawKeyUpEvent#6ed51(logicalKey: LogicalKeyboardKey#378ce(keyId: "0x0000006e", keyLabel: "N", debugName: "Key N"), physicalKey: PhysicalKeyboardKey#a0260(usbHidUsage: "0x00070011", debugName: "Key N"))
flutter: RawKeyUpEvent#5e514(logicalKey: LogicalKeyboardKey#e3a44(keyId: "0x200000106", keyLabel: "Meta Left", debugName: "Meta Left"), physicalKey: PhysicalKeyboardKey#f2ed2(usbHidUsage: "0x000700e3", debugName: "Meta Left"))
I did some tests(pressing meta left + N + 4). The raw key event callback didn't combine the keys together.
Let me research for ways we can achieve support for 'chords'
I was not able to find any solution to this problem. I hope the team does. Thus I am unassigning myself from this issue.
Description
As described in the title
Impact
Shortcut power users
Additional Context
No response