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?
Asked
Active
Viewed 824 times
2
-
1Can we see the code you are using? – epascarello Jun 10 '11 at 18:43
-
just a event listening to keydown in jquery and trying to figure out if its key code so i can stop the event. – Austin McDaniel Jun 10 '11 at 19:24
-
SHOW THE CODE! DO NOT EXPLAIN IT! Maybe caps will help:) – epascarello Jun 14 '11 at 11:16
1 Answers
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
-
Whats the property? I don't need another plugin, I just need to prevent this one case. – Austin McDaniel Jun 10 '11 at 19:41