jKey
jKey copied to clipboard
Numeric keyboard
Hi guys,
The keypress doesn't get registered for a number, if I press it on the numeric keyboard. Am I missing something?
Thanks :)
I modified my personal copy of jkey source code for numpad support. Insert the following anywhere into the var keyCodes:
'numpad0': 96,
'numpad1': 97,
'numpad2': 98,
'numpad3': 99,
'numpad4': 100,
'numpad5': 101,
'numpad6': 102,
'numpad7': 103,
'numpad8': 104,
'numpad9': 105,
'operanumpad0': 48,
'operanumpad1': 49,
'operanumpad2': 50,
'operanumpad3': 51,
'operanumpad4': 52,
'operanumpad5': 53,
'operanumpad6': 54,
'operanumpad7': 55,
'operanumpad8': 56,
'operanumpad9': 57,
Note that Opera is different than other browsers in its handling of numpad...refer http://unixpapa.com/js/key.html. So in your jquery code you have to do:
if ($.browser.opera) { $(document).jkey('operanumpad1', function () { .... }); } else { $(document).jkey('numpad1', function () { ..... }); }