-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[4.0] Shortcut Keys #24152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Shortcut Keys #24152
Conversation
This is a proof of concept for a new plugin offering keyboard shortcuts in the Joomla admin based on previous work by @jneubauer It uses the awesome mousetrap.js (please read the documentation there https://craig.is/killing/mice) For testing I have created the following shortcut keys General 1. mod+shift+1 Return to control panel Item 2. mod+shift+2 Save 3. mod+shift+3 Save and Close 4. mod+shift+4 Save and New 5. mod+shift+5 Save as copy 6. mod+shift+6 Cancel Lists 1. mod+shift+7 New 2. j h Help mod is the ctrl key on windows and cmd key on mac the key combination "j h" above is an example of gmail style shortcuts - press the keys in sequence not together By default none of these shortcuts will work when you are in a text or textarea field please no comments on codestyle or es6 etc - this is a proof of concept to see if it something we want
|
fwiw the Also it worth copying the tinyMCE bits from there, so the combo works also when the cursor is in the editors iframe |
|
As I said - by default NONE of these shortcuts work when the cursor is in a text area. Its just a config option to enable if desired |
|
@brianteeman also you don't need an extra script, just add the logic in the toolbar.js |
|
mousetrap is much better |
I always prefer less code and of course no dependencies, but that's me... |
|
I prefer maintainable code with no bus factor |
Just because you're pulling something from NPM is not automagically more maintainable or has a greater bus factor... |
|
Is a great and welcome feature! |
|
Just to make my self clear here, when I said
I meant the |
|
Ah. I misunderstood you there. As it's a proof of concept it's better on its own. If accepted it can be moved into that file of course |
|
Also it depends if people want it to be configurable by the user (or even disabled) or not. And anyway toolbar is probably not the best place as even in this example there are some that work on pages without a toolbar |
|
@brianteeman it can still be configurable, also by reading the code this works only with the toolbar buttons. |
|
From the point of view of a11y, this is extremely important and necessary functionality. |
|
The keys I used are just examples |
|
Great idea. Does this also include a hint list in the actual admin panel? |
|
Not yet. But it's supported by mousetrap |
|
@wilsonge fwiw if was still the JS leader I wouldn't accept this mousetrap script to enter the project's dependencies |
|
This should now be in native js and not use any external libraries. I have updated the original description. |
|
Sorry @dgrammatiko @wilsonge you were right - it didnt need the library at all |
|
Updating branch to trigger drone |
|
This works. However |
|
The docs say that alt on windows and opt on mac are triggered by Can you go to https://keycode.info/ and tell me the results you get for alt and opt on your mac |
|
I can only think then that the mdn documentation I linked to is incorrect and they keystrokes are ALT on both and OSx |
|
Trying to figure it out tbh. Like the docs says the option key. that seems different to the command key. And the symbol is the one I have on my alt key. I think the meta key is correct on macs https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey However saying that we start to override a bunch of browser short codes (nearly all the combinations you have are already native browser combinations) |
|
Using the meta key really isn't an option |
It is SHIFT and Alt |
|
Same result. |
|
might be a firefox bug - will investigate |
|
In Edge, Windows 10, US layout. |
|
I can confirm that the keyboard shortcuts I chose clash with some of the native browser shortcuts in firefox - grrh |
|
I am closing this. It really serves little value especially regarding accessibility |




This is a proof of concept for a new plugin offering keyboard shortcuts in the Joomla admin based on previous work by @jneubauer
For testing I have created the following shortcut keys
Save - Alt/Opt S
Save & Close - Shift + Alt/Opt S
Save & New - Shift + Alt/Opt N
Save as Copy - Shift + Alt/Opt C
Cancel/Close - Alt/Opt X
New - Alt/Opt N
Help - Alt/Opt H
Options - Alt/Opt
Alt/Opt means Alt key on Windows/Linux and Option key on Mac
When testing please report the operating system, browser, language AND keyboard layout/lang