Keyboard with text event three keyboard events:
1. KeyDown: Triggered when the user presses any key on the keyboard, and if pressed, the event is repeatedly triggered.
2. KeyPress: Triggered when the user presses a character key on the keyboard, and if pressed, the event is repeatedly triggered.
Pressing the ESC key will also trigger this time. Versions prior to Safari 3.1 also trigger the KeyPress event when a user presses a non-character key.
3, KeyUp: triggered when the user releases the key on the keyboard.
Although all venom support the above 3 events, they are most commonly used only when the user passes through a text input box.
There is only one text event:
1. TextInput: This event is a supplement to KeyPress, which is used to make it easier to intercept text before it is displayed to the user. The TextInput event is triggered before the text is inserted into the text box.
When the user presses a character key on the keyboard, the KeyDown event is triggered first, followed by the KeyPress event, and the KeyUp event is triggered at the end.
The KeyDown and keypress are triggered before the text box changes, while the KeyUp event is triggered after the text box has changed.
If the user presses a character key, the KeyDown and KeyPress events are repeatedly triggered until the user releases the key.
If the user presses a non-character key, the KeyDown event is triggered first and then the KeyUp event. If you hold this non-character key, you will
The KeyDown event is repeatedly triggered and the KeyUp event is triggered when the user releases the key.
KeyDown keypress KeyUp textInput