I would like to know the difference between keyup()
, keydown()
and keypress()
, in my opinion I think they do the same thing, but what is the purpose of each?
Performance improvement for each type?
I would like to know the difference between keyup()
, keydown()
and keypress()
, in my opinion I think they do the same thing, but what is the purpose of each?
Performance improvement for each type?
In fact they do not do the same thing.
keyup () : The event occurs when the key returns to its original position on the keyboard (i.e. when you release it).
keydown () : The event occurs when the key is pressed.
keypress () : The event occurs when the key is pressed.
The difference between keypress () and keypress () is that the latter is not captured when the ctrl , alt or shift are pressed.