When a context menu opens how do you know which keys are mapped to which entries in the menu? Is OS X just guessing or is there something that the developer specifically defined for these. In this particular menu when pressing E it jumps down near the bottom. Took a screenshot to show explanation.
2 Answers
In cases where there is not a visible shortcut, it is based on the title of next item. If you type the first few letters of the title of the menu, it will be selected. So if I wanted to select "Introduce Parameter" in your example above, I could quickly type I N T or I N T R to select it. My guess is that the case of "Extract" above, it is taking you to the next unique case alphabetically - you have three "Extract " listings and the next unique letter, alphabetically is "Extract *C*lass." If you wanted to select the previous entry, I think you'd be stuck with typing E X T T R A C T I
You can select Finder items on the Desktop, or in folders, in a similar manner. If I want to select a file called "my stuff", I can start typing M or M Y instead of single-clicking the file itself.
After repeated experimentation, it appears the principle involved as good old alphabetical order. A typed character causes the selection to jump to the item on the list first in alphabetical order that begins with the character you typed.
In your example, if you type E on its own, the selection jumps to the item on the list first in alphabetical order that starts with the letter "E". EX, EXT, etc. all will jump to that same Extract Class item because it comes first in alphabetical order.
If you wanted to jump to Extract Superclass…, you would need to quickly type EXTRACTspaceS.
-
1Wow that just seems wrong to have to type that much to get to the specific item in the menu. Windows and Linux seem to get this correctly by allowing you to define a specific key to jump to a given menu item and underlining the letter of said key to let you know which it is.– dstarhJun 4, 2012 at 16:18
-
I fully agree. I'm being descriptive here, not prescriptive. Were I designing the system, rest assured it would work quite differently!– Daniel ♦Jun 4, 2012 at 16:22
-
This doesn't appear to be the case in Chrome at least, where there is very little discernible pattern for which keys lead to which items, making it pretty useless. And typing the full text ("e.g. "SAVE IM" to get to "Save image As" doesn't work. Jan 14, 2019 at 6:23