views:

711

answers:

4

Hi,

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.

+2  A: 

Handling Keyboard Shortcuts in JavaScript

But I understand why few sites use it - this way has many difficulties. And encourage you to not use it too. Or not to make it as main feature.

maxnk
+1  A: 

If you enable this feature, make sure you can switch it on and off - be aware that your shortcuts may interfere or conflict with the built-in shortcuts that many of the assistive software packages out there (i.e. Jaws), and can be counterproductive in terms of accessibility.

Galwegian
+2  A: 

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.

Brian
+2  A: 

In order to implement this you need to register your required keyboard key combinations with JavaScript. It's like registering action listeners in C# for certain events. First URL I found on Google here seemed to have a good overview: Handling Keyboard Shortcuts in JavaScript.

Once keyboard events are registered you can then use the JavaScript to invoke AJAXy (technically JSON calls I think) operations on your ASP.net backend.

Matthew Ruston