jKey icon indicating copy to clipboard operation
jKey copied to clipboard

Numeric keyboard

Open Elven11 opened this issue 13 years ago • 1 comments

Hi guys,

The keypress doesn't get registered for a number, if I press it on the numeric keyboard. Am I missing something?

Thanks :)

Elven11 avatar Dec 11 '11 21:12 Elven11

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 () { ..... }); }

DavidFidge avatar Sep 12 '12 07:09 DavidFidge