views:

608

answers:

2

Hi,

I want to implement keyboard shortcuts using jQuery.

Specifically, I want to fire an event when e.g. F5 is clicked.

What kind of issues do you run into with keyboard shortcuts?

Also, any online chart that has all the keyboard mappings to numbers?

+4  A: 

You can't and shouldn't use F5 - its reserved by most browsers as refresh, and even you could you shouldn't want to confuse users by breaking UI conventions

You can use this little app to find out key codes

Simon
A: 

This little JS library will let you do it:

http://www.openjs.com/scripts/events/keyboard_shortcuts/

however there are some things to note.

1.) In IE, you can't AFAIK stop the event, you are just hooking in before it refreshes

2.) In IE, certain keyboard events you simply can't intercept... e.g. CTRL+S will always bring up the Save dialog, like it or not.

scunliffe