Window. event. keycode usage

Source: Internet
Author: User
Window. event. keycode-obtain the event. keycode value of the pressed keyboard.

1 keycode 8 = backspace

2 keycode 9 = tab Tab

3 keycode 12 = clear

4 keycode 13 = enter

5 keycode 16 = shift_l

6 keycode 17 = control_l

7 keycode 18 = alt_l

8 keycode 19 = pause

9 keycode 20 = caps_lock
10 keycode 27 = escape

11 keycode 32 = space

12 keycode 33 = prior

13 keycode 34 = next

14 keycode 35 = end

15 keycode 36 = home

16 keycode 37 = left

17 keycode 38 = up

18 keycode 39 = right

19 keycode 40 = down

20 keycode 41 = select

21 keycode 42 = print

22 keycode 43 = Execute

23 keycode 45 = insert

24 keycode 46 = Delete

25 keycode 47 = Help

26 keycode 48 = 0 equal braceright

27 keycode 49 = 1 exclam onesuperior

28 keycode 50 = 2 quotedbl twosuperior

29 keycode 51 = 3 Section threesuperior

30 keycode 52 = 4 dollar

31 keycode 53 = 5 percent

32 keycode 54 = 6 ampersand

33 keycode 55 = 7 slash braceleft

34 keycode 56 = 8 parenleft bracketleft

35 keycode 57 = 9 parenright bracketright

36 keycode 65 =

37 keycode 66 = B

38 keycode 67 = C

39 keycode 68 = d

40 keycode 69 = e eurosign

41 keycode 70 = f

42

43 keycode 71 = g

44 keycode 72 = H

45 keycode 73 = I

46 keycode 74 = J

47 keycode 75 = K

48 keycode 76 = L

49 keycode 77 = m mu

50 keycode 78 = n

51 keycode 79 = o

52 keycode 80 = p

53 keycode 81 = Q

54 keycode 82 = r

55 keycode 83 = s

56 keycode 84 = t

57 keycode 85 = u

58 keycode 86 = V v

59 keycode 87 = W

60 keycode 88 = x

61 keycode 89 = y

62 keycode 90 = z

63 keycode 96 = kp_0 kp_0

64 keycode 97 = kp_1 kp_1

65 keycode 98 = kp_2 kp_2

66 keycode 99 = kp_3 kp_3

67 key code 100 = kp_4 kp_4

68 key code 101 = kp_5 kp_5

69 key code 102 = kp_6 kp_6

70 key code 103 = kp_7 kp_7

71 key code 104 = kp_8 kp_8

72 key code 105 = kp_9 kp_9

73 key code 106 = kp_multiply

74 key code 107 = kp_add

75

76 key code 108 = kp_separator

77 key code 109 = kp_subtract

78 key code 110 = kp_decimal

79 key code 111 = kp_divide

80 key code 112 = F1

81 key code 113 = F2

82 key code 114 = F3

83 key code 115 = F4

84

85

86 key code 116 = F5

87 key code 117 = F6

88 key code 118 = F7

89 key code 119 = F8

90 key code 120 = F9

91 key code 121 = F10

92 key code 122 = F11

93 key code 123 = F12

94 key code 124 = f13

95 key code 125 = F14

96 key code 126 = F15

97 key code 127 = F16

98 key code 128 = f17

99 key code 129 = F18

100 keycode 130 = F19

101 keycode 131 = F20

102 keycode 132 = F21

103 keycode 133 = f22

104 keycode 134 = F23

105 keycode 135 = f24

106 keycode 136 = num_lock

107 keycode 137 = scroll_lock

108 keycode 187 = acute grave

109 keycode 188 = comma semicolon

110 keycode 189 = minus underscore

111 keycode 190 = period colon

112 keycode 192 = numbersign apostrophe

113 keycode 210 = plusminus hyphen macron

114 keycode 211 =

115 keycode 212 = copyright registered

116 keycode 213 = guillemotleft guillemotright

117 keycode 214 = masculine ordfeminine

118 keycode 215 = AE AE

119 keycode 216 = cent yen

120 keycode 217 = questiondown exclamdown

121 keycode 218 = onequarter onehalf threequarters

122 keycode 220 = less greater bar

123 keycode 221 = plus asterisk asciitilde

124 keycode 227 = multiply Division

125

126 keycode 228 = acircumflex

127 keycode 229 = ecircumflex

128 keycode 230 = icircumflex

129 keycode 231 = ocircumflex

130 keycode 232 = ucircumflex

131 keycode 233 = ntilde

132 keycode 234 = yacute

133 keycode 235 = Oslash ooblique

134 keycode 236 = aring

135 keycode 237 = ccedilla

136 keycode 238 = thorn

137 keycode 239 = ETH

138 keycode 240 = diaeresis cedilla currency

139 keycode 241 = agrave atilde

140 keycode 242 = egrave

141 keycode 243 = igrave

142 keycode 244 = ograve otilde

143 keycode 245 = ugrave

144 keycode 246 = adiaeresis

145 keycode 247 = ediaeresis

146 keycode 248 = idiaeresis

147 keycode 249 = odiaeresis

148 keycode 250 = udiaeresis

149 keycode 251 = ssharp question backslash

150 keycode 252 = asciicircum degree

151 keycode 253 = 3 sterling

152 keycode 254 = mode_switch

153

154 use the keycode attribute of the event object to determine the Input key value

155 eg: If (event. keycode = 13) Alert ("Enter !");

156 key value table

157 A 0x65 u 0x85

158 B 0x66 v 0x86

159 C 0x67 w 0x87

160 D 0x68X0x88

161 E 0x69 Y 0x89

162 F 0x70 Z 0x90

163G 0x71 0 0x48

164 H 0x72 1 0x49

165 I 0x73 2 0x50

166 j 0x74 3 0x51

167 K 0x75 4 0x52

168 l 0x76 5 0x53

169 M 0x77 6 0x54

170 N 0x78 7 0x55

171 o 0x79 8 0x56

172 p 0x80 9 0x57

173 Q 0x81 ESC 0x1b

174 R 0x82 CTRL 0x11

175 S 0x83 shift 0x10

176 t 0x84 enter 0xd

177

178

If you want to use the combination key, you can use event. ctrlkey, event. shiftkey, event. altkey to determine whether Ctrl, shift, and ALT are pressed. Example:
<script for="document" event="onkeydown()" language="JScript"><!-- if (window.event.keyCode == 27)  window.close();//--></script>
function keyPressed(e) {if (e.keyCode == 27)window.close();}onkeydown = keyPressed;

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.