Good day, im reading about keypress,key up and key down
key down = event will trigger after you press the key (more easy to understand based on definition and you can easily know how it works)
but im a bit confuse of key down and keypress i try to use them and it seems that they are the same based on functionality.
Just want to know more how key press and key down becomes different? thank you.
The difference is subtle but distinct. The key press event is triggered only for keys that produce characters, whereas keydown is triggered for all keys.
You can see the difference by creating a test page that captures both events for an input. You will see that both events are triggered when a key such as Q is pressed. But what about when you press the SHIFT key? What happens differently?
Bear Bibeault wrote:The difference is subtle but distinct. The key press event is triggered only for keys that produce characters, whereas keydown is triggered for all keys.
You can see the difference by creating a test page that captures both events for an input. You will see that both events are triggered when a key such as Q is pressed. But what about when you press the SHIFT key? What happens differently?
yes i see the difference of keydown and key press thank you
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Gift giving made easy with the permaculture playing cards