When I press . it fires the three events, keydown, keypress and keyup.
keydown
which: 190 == ¾
keyCode: 190 == ¾
keypress
which: 46 == .
keyCode: 46 == .
keyup
which: 190 == ¾
keyCode: 190 == ¾
When I press delete it fires two events, keydown and keyup.
keydown
which: 46 == .
keyCode: 46 == .
keyup
which: 46 == .
keyCode: 46 == .
I want to press . and be able to get the corresponding character (46 == .). But on keydown and keyup I get 190 which is ¾. On the keypress I get the correct value, but this event is not fired when I press delete.
When I press delete I get the code 46 on keydown and keyup. But the code 46 is a . and not delete.
How can I make an event to capture both keys and tell the difference, if it was a . pressed or delete key?
Page to test: http://jsfiddle.net/Eg9F3/
I’ve forced the same behavior as Firefox, example on jsFiddle