javascript - Why do numpad keycodes differ on windows v mac? -
using chrome, given following code (which paste console):
function key(e) { console.log(e.keycode); }; window.addeventlistener("keydown", key, false);
the keycodes on numpad seem vary. results below show keydown code
numpad 0:
mac (num lock on/off) keydown=48
win (num lock on) keydown=96
win (num lock off) keydown=45
can explain these differences please (since breaking our code)?
is expected or experiencing unusual behaviour? thanks
i believe mac numeric keypad maps normal number strip, not special key. if type normal 0
, keycode 48
on windows.
Comments
Post a Comment