How do you come up with new shortcut keys?


Anon asks, "How do you come up with new shortcut keys and how do you deal with different keyboard layouts? What is the process; is there a company-wide procedure to keep things consistent?"

This is several questions (none of them really a suggestion, but I've given up on making the Suggestion Box about suggestions; now it's just the "Ask Raymond a question" page), so let's take them one at a time. (Note that if you ask multiple questions, you reduce the likelihood that I'll answer them, because I feel obligated either to answer all of them or none of them.)

First question: How do you come up with new shortcut keys?

You just make them up. Application shortcut keys are local in scope (either to a dialog box, or to a menu, or to a top-level window message loop via the accelerator table), so you can just pick something that does not cause duplication within your local sphere.

Second question: How do you deal with different keyboard layouts?

To deal with different keyboard layouts, you, um, deal with different keyboard layouts. Menu shortcuts, dialog box shortcuts, and accelerator tables are all localizable, so translators can assign them to whatever key they feel works best on the keyboard layouts most likely to be used by their specific audience.

If you want your shortcut to be invariant across keyboard layouts (such as Ctrl+C for copy, regardless of language) then you (or somebody you trust) need to check all the keyboard layouts to make sure your desired shortcut key is available on all of them. For example, the keyboard shortcuts for snapping, unsnapping, and repositioning applications in Windows 8 were originally going to be Win+[ and Win+]. However, upon checking with the globalization folks, it became clear that those hotkeys were not going to work, because on many keyboards, typing [ and ] requires the use of the AltGr modifier. Users would have had to press Win+AltGr+[ to move the gutter to the left, or if they didn't have an AltGr key, Win+Ctrl+Alt+[. This was clearly far too unwieldy, so the hotkeys were changed to Win+. and Win+Shift+..

Third question: Is there a company-wide procedure to keep things consistent?

Since application shortcut keys are local in scope, there is no need for a company-wide procedure to keep them from conflicting with each other. Each application can assign its shortcut keys as it sees fit. And maintaining consistency across applications is done the same way gas stations and airlines maintain consistency in pricing: You look at what everybody else is doing and try to be consistent with them. This creates a first-move advantage: If the first application to create a Properties menu item assigns it the keyboard shortcut Alt+R, then that makes it likely that the second and third applications which add a Properties menu item are likely to use the same shortcut.

Windows 95 introduced a lot of new items into context menus (such as Properties), so the Windows 95 design team got to choose a lot of important keyboard shortcuts. In Explorer, hit Shift+F10 and look at the Properties menu item. On English systems, it shows up as Properties. The shortcut is still Alt+R, over a decade later.

Besides, imagine if there was some company-wide procedure for keeping things consistent. First, you would have to make sure everybody knew about this procedure. "What, there's a procedure I have to follow before I can assign menu and dialog shortcut keys and application accelerators?"

And then everybody would complain, "Oh great, before I choose a shortcut, I have to fill out this application in quadruplicate and then show up at yet another meeting." Microsoft is famous for its burdensome meetings. You don't address this problem by adding more meetings. (Note that I don't share that author's views, probably because I don't go to many meetings.)

New shortcut keys are added all the time. A single dialog box can have a dozen or more. Imagine being on the shortcut-key-consistency committee. Your day would be wall-to-wall meetings about shortcuts. "Yes, the standard shortcut for Properties in German is Alt+E (for Eigen­schaften), but we'd like to apply for an exception because our menu also has an Insert command (German: Ein­fügen) and the standard shortcut for that is also Alt+E. Since Insert is used much more often, we'd like to keep Alt+E for Ein­fügen and use Alt+G for Eigen­schaften." And when somebody came to you with the request, how would you decide whether to approve or reject it? Probably by saying, "Well, let's see how other applications handle this." So your big complicated hotkey approval process reduced to what people would have done anyway. Congratulations, you just wasted everybody's time.

Comments (17)
  1. I'm guessing that you've got to put a little bit more thought in to something system wide like Windows+D/Alt+Tab than you would for something application wide like Ctrl+O in Notepad?

  2. Brian_EE says:

    In Explorer, hit Shift+F10 and look at the Properties menu item. On English systems, it shows up as P&roperties. The shortcut is still Alt+R, over a decade later.

    I was about to correct you, then I realized you said Explorer, not Internet Explorer. In IE it is &Properties and the shortcut is Alt+P. So much for "do what other applications do", lol.

  3. xpclient says:

    In Windows 8, someone changed Aero Peek from Win+Space to Win+Comma, Switch Language from Alt+Shift to Win+Space, Win+X from Mobility Center to Win+X menu. Has shortcut keys' compatibility been broken like this in older Windows versions? I remember Backspace changed to Alt+Up for Up One Level. And since Vista, Win+Pause/Break gets me to System Properties but the stuff I need the most has been moved to Advanced System Properties for fun and games. And Paint's Invert Selection changed from Ctrl+I to Ctrl+Shift+I and kept a secret. And Play/Pause of Media Player changed from Space to Ctrl+P!!

    [I guess you forgot all about Windows 95. -Raymond]
  4. David Walker says:

    In the Suggestion Box, people are suggesting that you answer various questions that they have wondered about for years and can't get answered anywhere else!  It's a valuable resource!  :-)

  5. For example, the keyboard shortcuts for snapping, unsnapping, and repositioning applications in Windows 8 were originally going to be Win+[ and Win+]. However, upon checking with the globalization folks, it became clear that those hotkeys were not going to work, because on many keyboards, typing [ and ] requires the use of the AltGr modifier. Users would have had to press Win+AltGr+[ to move the gutter to the left, or if they didn't have an AltGr key, Win+Ctrl+Alt+[. This was clearly far too unwieldy, so the hotkeys were changed to Win+. and Win+Shift+..

    But why don't use same shortcuts as desktop applications with Win and arrow keys?

  6. Paul M. Parks says:

    Regarding the suggestion box, I think you may end up with a reverse Jeopardy situation: "Please phrase your question in the form of a suggestion."

  7. It would be nice if someone collated a web page/site listing shortcut keys, and menus for that matter; I recall some years ago having a boss whose stock answer to UI questions was "make it like Windows". The File menu was to be "like Windows" … never mind that Explorer doesn't even HAVE a File menu, and he probably didn't mean to mimic Program Manager. (The end result had most of the File menu from Word XP, which we were using at the time, minus the bits that don't apply to a financial modelling product.)

    Wikipedia has a promising-sounding page, 'table of keyboard shortcuts', but only covers operating system/shell shortcuts plus some web browsers. RIM and Apple both have support pages for their respective platforms, but a broad overview would be nice. (I might even give it a try myself sometime soon…)

  8. Joshua says:

    @jas88: If he'd said that to me I'd have copied from Notepad as it seems to be the last Windows component to use a normal menu.

    Which it should, given that it has to run from Server Core.

  9. Paul M. Parks says:

    @jas88: The Windows User Experience Interaction Guidelines should have what you're looking for.

    msdn.microsoft.com/…/aa511258.aspx

  10. Togo says:

    Regarding AltGr: not only is it unwieldy to compose any keyboard shortcut involving <CHAR> where <CHAR> requires AltGr+<KEY> to be composed(*) on any given keyboard layout, it actually makes it impossible to use them if the shortcut uses Ctrl! The reason is that, as you mentioned, AltGr is equivalent to Ctrl+Alt. So the virtual key code of the WM_KEY* messages, as well as the key state obtained by calling GetKeyboardState(), are the same if you press Ctrl+AltGr+<KEY> and AltGr+<KEY>.

    Conclusion: triple-check any keyboard shortcuts involving Ctrl!

    (*) Examples, on my fr_CH keyboard, are []{}#@¦

  11. Is the shortcut for Properties on English systems really Alt+R? I use a Dutch system, so it's different for me, but on my Windows 7, when I press Alt, the context menu closes. I can open the Properties window with Shift+F10 (or the context menu key), then C-without-Alt (for Eigens_c_happen). Or do English systems have an Alt+R shortcut outside of context menus?

    ["Alt+R" was shorthand for "invoking the keyboard accelerator in the appropriate manner to execute the item where the R is underlined, either pressing a plain R if invoked directly as a pop-up context menu, or Alt+R if invoked via the File menu." I guess I need to write even more formally now. -Raymond]
  12. Michael Geary says:

    @h.v.dijk: No, it's not Alt+R and never could have been, at least as far back as I can remember. As you said, if you press the Alt key with the context menu open, it immediately closes the menu. The actual shortcut with the context menu open is simply the letter R.

    The direct shortcut to open Properties in Explorer (without using the context menu) is Alt+Enter. This used to work everywhere in Explorer, but in Vista it got broken in Explorer's tree panel, and it's still broken in Windows 7 and 8.

  13. DaveL says:

    No, English systems work the same way as your Dutch one does. Pressing Alt will close the context menu. Just the letter key is the accelerator.

    The real properties accelerator is Alt+Enter – but only in the listview pane for recent OS's implementations of Windows Explorer.

  14. Alt+R works if you don't already have the context menu open. If the menu's already open, you just need to hit R (or whatever letter). If you just tap Alt (rather than holding it and striking a second key), the menu will take focus, underlining the shortcut letter for each menu item, and you can then hit the appropriate letter as a separate keystroke as well.

  15. DaveL says:

    "Alt+R works if you don't already have the context menu open"

    Are you sure? It certainly doesn't work as an accelerator to show the property pages for me.

  16. NP says:

    There are system-wide shortcuts for which there must be a more formalized process for choosing them, as it is very easy to come up with shortcuts that would conflict with existing application shortcuts, which might not be easily localizable and which might not be easy to remember or use, especially for people with assistive technologies. I am shocked that a more formal procedure, at least for such system-wide shortcuts, is not followed.

    Also, what about consistency. Surely many shortcuts are local to an application but there must be a consistent usage pattern across Windows.

    In my experience I find that more recent versions of Windows, unlike Windows 95/98, contain many bugs having to do with keyboard usage. For example, Esc does not work when some of the fields in the Open/Save dialogs in Windows Vista/7 are highlighted. I have observed the bug with alt+enter mentioned above too. And Explorer and Windows Media Player beep when you select an item in the folder tree or the list of songs respectively. Plus many more bugs which are never fixed. I guess nobody uses the keyboard in Microsoft any more?

  17. ["Alt+R" was shorthand for "invoking the keyboard accelerator in the appropriate manner to execute the item where the R is underlined, either pressing a plain R if invoked directly as a pop-up context menu, or Alt+R if invoked via the File menu." I guess I need to write even more formally now. -Raymond]

    I didn't even think about the File menu. Actually, even in that menu, pressing Alt closes it. However, if you open the File menu with Alt+B (again, Dutch system), then shortcut keys work regardless of whether you release the Alt key. Both (hold Alt, press B, press H, release Alt) and (hold Alt, press B, release Alt, press H) work and do the same thing. That takes extra effort to get right, I never noticed it before, and I'm impressed. What also surprises me is that in the File menu, the Properties item is called Eigensc_h_appen, with H as its shortcut key, and appears directly below the Rename item. In the context menu, it is Eigens_c_happen, and there is a separator between the Rename and Properties items. Other menu items also differ in the chosen shortcut keys. I guess that's because the File menu also has an extra Close item at the very bottom taking up one fixed shortcut key, so it would look bad if the Properties item had a separator directly above and below it, and the shortcut keys for the other items get adjusted so that they don't conflict with Close.

Comments are closed.