-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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.2] [GSoC 21] Keyboard-Shortcut Plugin #38092
Conversation
Co-authored-by: Harald Leithner <[email protected]>
…ccessibility into keyboard-shortcut
Co-authored-by: Quy <[email protected]>
I have tested this item ✅ successfully on b223844 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38092. |
I have tested this item ✅ successfully on b223844 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38092. |
|
Sorry, that one got lost in all the comments. I'll have a look on that, maybe preventing defaults after J was pressed (not X alone) could be enough. |
jx is a dl but the description in the plugin is a ul |
Now the hint only appears on cpanel-pages like the home dashboard. As you said - its only useful at the beginning |
It seems like NVDA interrupt the keyboard input before js can do/prevent anything. Even when I change the shortcuts to something NVDA does not use, nothing happens besides making a sound. When we configure modifiers like ALT, they do not work in sequence because the browser interrupts (at least in my tests). What do you think @brianteeman ? :/ |
(not at my pc to test) what happens on github when you use nvda and the github shortcuts? |
I tried out s for githubs search and I'm not jumping into the search field as long as nvda is running. Same with g and n, which should normally open notifications. |
...but the command palette (which opens on ctrl+k) works with nvda |
It looks like its a known issue with the nvda single character shortcuts |
yes looks like this is one of those cases where a real screen reader user knows what to do. "In browse mode, you can now toggle single letter navigation on and off by pressing NVDA+shift+space. When off, single letter keys are passed to the application, which is useful for some web applications such as Gmail, Twitter and Facebook." or you switch from browse to focus mode. Havng read the nvda manual link I am happy enough that the current code is ok to merge |
Thanks everybody! :) |
thank you all. Cant wait to read the docs how this can be extended by extensions |
I wrote an example in the test instructions which I used myself to test added shortcuts. But yes, docs will follow. |
joomla/joomla-cms#36591 + joomla/joomla-cms#37362 + joomla/joomla-cms#37404 - (позже был Revert PR) joomla/joomla-cms#37453 + joomla/joomla-cms#37583 + joomla/joomla-cms#37459 + joomla/joomla-cms#36751 + joomla/joomla-cms#36752 + joomla/joomla-cms#37912 + joomla/joomla-cms#37838 + joomla/joomla-cms#38002 + joomla/joomla-cms#38036 - (только для en-GB, у нас давно исправлено) joomla/joomla-cms#38009 + joomla/joomla-cms#38064 + joomla/joomla-cms#37911 + joomla/joomla-cms#38065 + joomla/joomla-cms#38075 + joomla/joomla-cms#38071 + joomla/joomla-cms#38080 + joomla/joomla-cms#38082 + joomla/joomla-cms#38092 + joomla/joomla-cms#38113 + joomla/joomla-cms#38121 + joomla/joomla-cms#37910 + joomla/joomla-cms#38165 + joomla/joomla-cms#37747 +
Summary of Changes
This is a new plugin, developed in the GSoC 21 Accessibility project.
It introduces keyboard shortcuts to the administrator site like pressing J + F to jump into the search field or J + S to save. Other extensions are able to add their shortcuts as well by hooking in on the
onLoadShortcuts
event. All(!) of them are listed in a modal window, which shows up by pressing J + X.The current state is just the start. Further steps would be the editing of shortcuts, the possibility to disable them, changing the overview-text-hint to a button in the corner etc. The editing was there already but it had some flaws, so it will come later (without flaws) :)
Thanks to @Krshivam25 the student behind this GSoC project, @chmst, @bembelimen, and @brianteeman for alle the work and feedback!
Testing Instructions
Make sure the shortcut plugin is enabled and start by pressing J + X (in sequence, not at the same time!) for the overview. Have a look at the hint, which tells you the same at the bottom of the page. Then visit different pages and try out the shortcuts :)
If your motivated you can let your plugin add new shortcuts and test them! Add "onLoadShortcuts" to the getSubscribedEvents and write something like this:
Actual result BEFORE applying this Pull Request
You needed to click on buttons to do something
Expected result AFTER applying this Pull Request
You can use your keyboard to do something (besides typing text)
Documentation Changes Required
Yes, I will create a page to describe the build up of the shortcuts, how extensions can add them and what the default joomla shortcuts are. Part of it would be:
The 3rd party plugin needs to provide an array of shortcuts which are objects:
{ shortcut: string, selector: string, title: string }
The shortcut needs to be a keyboard input, separated by a plus e.g. "J + Y" or "ALT + Z + 7" (currently there is really no filtering).
Selectors are like CSS selectors to target an element. When it is an input element, the shortcut gives focus, otherwise it will be clicked.
The Title will be displayed in the overview. It could be the name of the target.