AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
57.11k stars 3.74k forks source link

[FR] Shortcut to skip ahead to the next header or blank space #2313

Open annieappflowy opened 1 year ago

annieappflowy commented 1 year ago

Description

As described in the title

Impact

Shortcut power users

Additional Context

No response

MayurSMahajan commented 1 year ago

What key combination do we want for this?

annieappflowy commented 1 year ago

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

image
MayurSMahajan commented 1 year ago

@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:

  1. Try to come up with some different shortcuts for navigating to the next header or blank space.
  2. Enable support for shortcuts with chords.

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?

annieappflowy commented 1 year ago

Ideally we should follow the convention. @LucasXu0 , please evaluate

LucasXu0 commented 1 year ago

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.

MayurSMahajan commented 1 year ago

Let me research for ways we can achieve support for 'chords'

MayurSMahajan commented 6 months ago

I was not able to find any solution to this problem. I hope the team does. Thus I am unassigning myself from this issue.