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

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -