Literature review

Plenty of ink has already spilled in this war.

On one side is truth and justice, on the other, the misguided people who think their sites need a keyboard shortcut “feature.” This comment on Super User sums it up:

It’s so absurd to me, because the only way anyone will discover this “feature” is by trying to use [the slash key] for its usual purpose! The only people who are affected by this are the ones who are frustrated by it!

Custom shortcuts are bad for accessibility, bad for power users, unlikely to be useful to most users, and difficult to implement correctly.

Custom shortcuts break user expectations

Not only do custom shortcuts interfere with what power users expect of their browser, but they are even worse for users who can’t physically use a mouse. This includes motor impairments and, to some extent blindness.

“Wait,” you might think, “if my users can’t use a mouse, won’t my shortcuts help them?”

No!

Your users won’t know what your particular shortcuts are and you have a good chance of breaking shortcuts that they need to navigate your site. Screen readers, for example, provide many shortcuts you don’t know, but their users require.

Custom shortcuts are hard to implement

Oh sure, it seems simple enough, but wait until you really get into the details.

Have you thought about international keyboard layouts? If “dead key” doesn’t mean anything to you, you don’t know enough to implement keyboard shortcuts reliably.

Do you know how all the keyboard event parameters differ? Here are some of them:

  • keyCode
  • charCode
  • code
  • keyIdentifier
  • key
  • which

When you should make custom shortcuts

Despite the above, there are times when custom shortcuts are appropriate, so Keyboard Savior Xtreme makes exceptions.

  • Custom modals like popups should always impleemnt escape to close
  • Rich-text editors and similar should implement shortcuts analogous to the well-known shortcuts in their native counterparts
  • Games

In almost every other case, custom keystroke handlers are a mistake.