KeyDown keypress KeyUp textInput

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.