#16262 closed enhancement (fixed)
Menu: implement single letter accessKey
Reported by: | Douglas Hays | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | #16265 | Blocking: |
Description
When a menu has focus, normally child items have single letters underline that act like shortcuts.
Attachments (1)
Change History (11)
comment:1 Changed 10 years ago by
Blocked By: | 16265 added |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Milestone: | tbd → 1.9 |
---|
From http://msdn.microsoft.com/en-us/library/75y70dx3(v=vs.80).aspx, "The difference between access keys and keyboard shortcuts is that you can use a keyboard shortcut to choose a menu item without first displaying its menu.". The current accelKey is a shortcut, and this feature is definitely an access key. The problem is that dijit's Menu widgets remain active in the minds of browsers (at least Chrome) even when inactive. If the Menu widgets' accesKey definition cannot be hidden in this scenario (seems it would involve removing accessKey from all child items and reapplying later), then the new attribute name for this feature should be something similar to accessKey but disambiguated to reflect it only works when the Menu has focus and not with ALT (focusedAccessKey?).
comment:4 Changed 10 years ago by
What is there's no attribute name at all but rather the access key is embedded in the data stream to better allow for translations. Then the set label method can easily strip out the {},
File becomes {F}ile
編集 becomes 編集 ({E})
comment:5 Changed 10 years ago by
\ would be nice as well since it better implies special treatment for a single letter:
Save \As in markup or "Save \\As" in JS
comment:6 Changed 10 years ago by
From http://msdn.microsoft.com/en-us/library/75y70dx3(v=vs.80).aspx, "The difference between access keys and keyboard shortcuts is that you can use a keyboard shortcut to choose a menu item without first displaying its menu.". The current accelKey is a shortcut, and this feature is definitely an access key.
Yes, it's clear the terminology used by browsers is confusingly different than the terminology used by Microsoft.
I also noticed in that link that:
If you don't assign an access key to a menu title or menu item, Visual FoxPro automatically assigns the first letter as the access key. For example, the Customer menu created previously didn't have a defined access key. Accordingly, Visual FoxPro assigned the first letter (C) as the access key."
It's an interesting idea since it makes menu behavior consistent, rather than behaving slightly differently (ex: focusing but not executing) based on whether or not the app specified a shortcut key (or whatever you want to call it).
The only downside I see is that if menus are unlucky enough to have two items that start with the same letter, they need to explicitly specify a shortcut for one of them, or the behavior will not be well defined. That seems like a reasonable restriction, except in special cases like menus listing things like documents (ex: the "recently opened" submenu under the "File" menu).
the new attribute name for this feature should be something similar to accessKey but disambiguated to reflect it only works when the Menu has focus and not with ALT (focusedAccessKey?). ... What is there's no attribute name at all but rather the access key is embedded in the data stream to better allow for translations.... File becomes {F}ile 編集 becomes 編集 ({E})
By "better allow for translations" I guess you are saying that part of the "translation" is to change the shortcut letter. Not true for Japanese but I think it's true for other languages like German, so this seems like a good idea. Plus, as you implied, it means you don't need to think of a name for a new parameter.
One more note: seems like setting accessKeys (in web terminology) on web pages have a lot of issues, most notably that if the app designer isn't very careful, they will mask access to the browser's menu, thus reducing accessibility rather than making it better.
comment:7 Changed 10 years ago by
comment:8 Changed 10 years ago by
Owner: | changed from bill to Douglas Hays |
---|---|
Status: | new → assigned |
See for example