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

go - serving up pdfs using golang -

how to add preprocess loader in webpack 2 -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -