Buttons and mouse clicks
Event Name Description
Onkeypress occurs when the user presses and releases any alphanumeric key. System buttons (for example, arrow keys and function keys) cannot be identified.
Onkeyup occurs when the user releases any previously pressed keyboard keys.
Onkeydown occurs when you press any keyboard key (including system buttons, such as the Arrow keys and function keys.
<Script language = JavaScript>
Function keydown (){
If (window. event. altkey )&&
(Window. event. keycode = 37) | // mask Alt + direction key seek
(Window. event. keycode = 39) {// mask Alt + direction key →
Alert ("You are not allowed to use Alt + arrow keys to move forward or backward the webpage! ");
Event. returnvalue = false;
}
If (event. keycode = 8) | // shield the unregeed deletion key
(Event. keycode = 116) {// block the F5 refresh key
Event. keycode = 0;
Event. returnvalue = false;
}
If (event. ctrlkey) & (event. keycode = 78) {// block Ctrl + n
Event. returnvalue = false;
}
If (event. shiftkey) & (event. keycode = 121) {// block SHIFT + F10
Event. returnvalue = false;
}
If (event. keycode = 122) {// block F11
Event. returnvalue = false;
}
}
}
Function document. onkeydown ()
{
If (event. keycode = '39 ') //-> right arrow
{
Window. Open ("http://www.163.com ");
}
}
Function document. onkeypress ()
{
If (event. keycode = '13 ')
{
Alert ('Enter the "enter" key on the keyboard ');
Return changepagego ();
}
}
</SCRIPT>
ASCII code keyboard
27 ESC 32 space 33! 34"
35 #36 $ 37% 38 &
39 '40 (41) 42 *
43 + 44 '45-46.
47/48 0 49 1 50 2
51 3 52 4 53 5 54 6
55 7 56 8 57 9 58:
59; 60 <61 = 62>
63? 64 @ 65 a 66 B
67 C 68 d 69 E 70 f
71g 72 h 73 I 74 J
75 K 76 l 77 m 78 N
79 o 80 p 81 Q 82 R
83 s 84 T 85 U 86 v
87 W 88x89 y 90 Z
91 [92 \ 93] 94 ^
95 _ 96 '97 a 98 B
99 C 100 D 101 E 102 F
103G 104 H 105 I 106 J
107 K 108 L 109 m 110 n
111 o 112 P 113 Q 114 R
115 s 116 t 117 U 118 v
119 W 120x121 y 122 Z
123 {124 | 125} 126 ~
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.