2

So in Firefox when i do a key combination like: SHIFT + "," which would equal "<" the key code comes back as '0'. Same thing is true for keys: "." ">" and many others. Anyone have any ideas?

1 Answers1

0

You can use jquery plugin, if you use jquery already. And maybe see how they did it in those plugin.

edit

In jquery hotkeys there is object for mapping characters with shift:

shiftNums = {
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
}

There are also lines:

character = String.fromCharCode( event.which ).toLowerCase();

var tmp = shiftNums[ character ];

This should help you. Source code. About which. BTW: source code of jquery hotkeys is such small so it wouldn't affect size of your scripts:)

Community
  • 1
  • 1
pmaruszczyk
  • 2,157
  • 2
  • 24
  • 49