jQuery keyboard events are described
jQuery handling keyboard events have three functions, depending on the order of incident,:
1. Keydown ();
3. KeyPress ();
The keydown event is triggered when the keyboard is pressed, and can return false to the binding function to prevent the browser’s default event.
The keyup event is triggered when the button is released, that is, the incident after you press the keyboard.
KeyPress events will trigger when tap button, we can understand and raise the same button.
Keyboard events can pass a parameter EVENT, In fact, there is a parameter in the jQuery event function:
If we want to implement Ctrl + Enter is Ctrl + Enter SubmitForm
In the above code, Event.KeyCode can help us get us What is the button? He returned the ASCII code. For example, the upper and lower keys are 38, 40, 37, 39