views:

61

answers:

2

Hi,

I am developing quite large web app and it is probably good idea to use hotkeys for some common tasks. However I discovered that finding safe key combinations is a problem, regarding all different browsers and OSes. For example Chrome has such a long list of hotkeys that trying to use some kind of logical hotkeys scheme for my webapp is impossible - e.g. ctrl+1, ctrl+2, ctrl+3, etc ...

So I repeat my question, do you have some cheatsheet of safe hotkeys which can be used in webapp and not worry about some browser or OS interference ?

Thank you.

A: 

I don't think there is such a list. This may even be different for different locales.

You can try to rely on the accesskey feature of HTML: http://www.w3.org/TR/html401/interact/forms.html#adef-accesskey. This should keep the number of collisions relatively small. Though I believe the Windows browsers will offer these keys as Alt+Letter which collides with the menu bar.

Alternatively do what Google reader and Gmail do: use the letters directly without any hotkey modifier. That will only work for certain types of applications, though.

Patrice
Thanks for answer. Problem is that most of the functionality with hotkeys happens in textbox, so accesskey is useless in this case.User enters shop items in a form, and right now I am using for example ctrl+enter as a shortcut to add shop item or ctrl+f1 to lookup item using ajax to see if it already exists, and so on....I spend some time googling on this and I think there really isn't list of generally available hotkeys for web apps. I just thought someone here could have made one for him or herself.
Frodik
A: 

I wouldn't count on it. It's probably okay to listen for shortcuts that use the alt modifier, but there's still no way to be sure a keyboard shortcut is free. Users can always install programs that listen for keyboard shortcuts, or use a browser you didn't expect.

If the shortcuts can be used only when the user is not typing in a textbox or something, it might be a better idea to just listen for keys pressed without a modifier key.
If no textbox or other gui element is focused, then document.activeElement == document.body should be true. (Somebody correct me if I'm wrong).

BernzSed