Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing shortcut keys in a webpage

I was thinking of implementing shortcut keys in a pet web application, I am developing for me. I am using c# and asp.net.

I have seen very few web-sites( frankly I remember only g-mail), which have shortcut keys.

Has anyone ever implemented shortcut keys for a web application, if yes how to go about it?

Thanks.

like image 809
Biswanath Avatar asked Dec 15 '08 14:12

Biswanath


2 Answers

Accesskeys are useless, but visit this site if you insist on using them. Much better to use this than javascript, though the ways of accessing access keys varies across browsers. The advantage of this over ugly Javascript solutions is that it leaves it up to the browser and the user's browser settings to handle them.

like image 163
Brian Avatar answered Oct 14 '22 08:10

Brian


Mousetrap is an excellent JavaScript library for handling shortcut keys.

Based on how I've seen other apps (Gmail, JIRA) use shortcut keys, and based on my own experience, I would make a couple of suggestions:

  • Interfering with browser shortcut keys is a real possibility. The most reliable way to avoid this is to use unmodified letters (i.e., A instead of Ctrl-A or Alt-A).
  • Keyboard shortcuts are relatively rare for web sites, so they suffer from poor discoverability. Since they're not very discoverable, you'll need to add, e.g., tooltips or unobstrusive hints letting users know that they exist. Keyboard shortcuts seem to be most useful for web applications, like Gmail and JIRA, that are expected to be used heavily; otherwise, there's just not enough opportunity or benefit to learning them.
like image 31
Josh Kelley Avatar answered Oct 14 '22 07:10

Josh Kelley