Closed ebruchez closed 3 months ago
When showing the hints, we need to show the ones appropriate for the given platform. For example on Apple platforms, we use ⌘Z
, while on Windows/Linux we use ⌃Z
.
One way to do this would be, on the client, to replace all title="... (⌘Z)"
with title="... (⌃Z)"
. This is assuming that only the modifier changes.
BTW right now, with #5783, we register undo/redo/cut/copy/paste on the client. However, we could have other shortcuts that use the ⌘
modifiers, so we cannot just hook things up there.
Ideally, we'd like a more general, descriptive way of triggering actions with shortcuts, that can be configured for each client platform. Note that we do not have a use case right now to let admins or users configure their own shortcuts. Very few web apps do this (in fact none comes to mind).
If we are ok, at first, just replacing the modifier ⌘
with ⌃
, then a simple query/replace works.
Note that we do not have a use case right now to let admins or users configure their own shortcuts. Very few web apps do this (in fact none comes to mind).
True, the only one that comes to mind is Roam. Regarding use cases, I think they mostly stem from the difficulty of finding keyboard shortcuts that work across platforms, browsers, and keyboard layouts.
For instance, over the years, I've encountered a number of web apps with keyboard shortcuts that worked on Chrome on macOS and Windows, but were unusable on Safari (which is much more restrictive than Chrome regarding which keyboard shortcuts are allowed through to the web app), iPadOS, or ChromeOS (where certain key combinations are reserved by the OS). Similarly, I've heard from people using non-US keyboards about having similar problems with certain web apps.
Allowing users to configure their own shortcuts enables us to ship the product with reasonable defaults that work well on Chrome, Windows, and MacOS with a US keyboard, and lets users change those defaults if they're not usable or convenient on their specific browser/OS/keyboard combination.
However, I agree that having a good set of keyboard shortcuts that work well, say, on Chrome, Windows, and MacOS, is the priority. This should be done before we create a UI that lets users configure their own shortcuts.
It would be good if shortcuts associated with triggers could be registered declaratively, either at the XForms level or the XBL level.
For example fr:process-button
could:
keyboard-shortcut
attributeMousetrap
We have an old fr:button
but it is obsolete. Otherwise, it would be good if xf:trigger
could do it, but it's easier with XBL.
<fr:process-button keyboard-shortcut="⌘⇧Z ⌃Y" name="foo">
The button name could be used to read shortcuts from properties:
<property
as="xs:string"
name="oxf.xforms.xbl.fr.process-button.keyboard-shortcut.foo"
value="⌘⇧Z ⌃Y"/>
A <kbd>
element would be output automatically.
Done so far:
Remaining tasks:
kbd
on buttons bar hover only
We have some keyboard shortcuts, but they are not discoverable.
Some are platform-dependent, but some not. For now, show hints for the platform-independent ones where possible.