5 ms·
You can override "web safe" keyboard shortcuts (for example, "CTRL+S") in a pretty standard way, with or without a library. The biggest issue I think is the exp
by tlackemann 7y ago
You can override "web safe" keyboard shortcuts (for example, "CTRL+S") in a pretty standard way, with or without a library. The biggest issue I think is the expected behavior for the user. If I press CTRL+S, do I expect the same HTML dialog or something custom in the app. Depends on the experience.
For different OS/browsers, the library I wrote for react shortcuts (see comment history for this post) handles this behind-the-scenes. CTRL/CMD are interchangeable depending on MacOS vs anything else.
Handling educed shortcuts is an interesting point I don't believe a lot of people are exploring. With increasingly complex apps being built that often rely on memorizing shortcuts, what alternatives exist beyond good design? I don't know the answer myself but am open to thoughts on how that might be achieved.
- iudqnolq 7y ago> With increasingly complex apps being built that often rely on memorizing shortcuts, what alternatives exist beyond good design? I think it's key to make the shortcuts discoverable inline. Maybe by default, maybe with a modifier pressed, every button and menu item should show the shortcut for it. Also take a look at the experience in Spacemacs, where you compose multiple keys for a shortcut and if you pause you get a pop-up showing possibilities (eg press , to get major mode specific, then pause to see options, press x for text, then pause to see all the options for the next letter. Then when you know it you just quickly hit ,xi) (I vaguely remember someone else wrote this and Spacemacs popularized it, but I can't find the name)
- jcagalawan 7y agoInteresting to me is that a lot of native apps have similar functionality with the Alt key to navigate menus. Certain menu options would have an underlined character and you'd hit that character to select it like in Spacemacs. I never use those in apps outside of Spacemacs. I think the bottom bar succinctly showing you all the options when you hit space/comma really makes discoverability a lot easier than in traditional apps.