Skip to Content
JavaScript & DHTML Cookbook, 2nd Edition
book

JavaScript & DHTML Cookbook, 2nd Edition

by Danny Goodman
August 2007
Intermediate to advanced
603 pages
15h 51m
English
O'Reilly Media, Inc.
Content preview from JavaScript & DHTML Cookbook, 2nd Edition

Appendix B. Keyboard Key Code Values

Key codes are numeric values that correspond to physical keys on the keyboard but do not necessarily correspond to a particular character. For example, the A key on the keyboard produces the same key code when pressed, even though its character code might be 65 (uppercase A)or 97 (lowercase a), depending on whether the Shift key is down at the same time. Key codes are not influenced by modifier keys. Character values (see Appendix A) may be read from the keypress event, while the key values, including navigation and function keys, are available from keydown and keyup events. The following table lists all keys on a typical U.S. English keyboard and their corresponding key codes.

Key

Key value

Key

Key value

Alt

18

F5

116

Arrow Down

40

F6

117

Arrow Left

37

F7

118

Arrow Right

39

F8

119

Arrow Up

38

F9

120

Backspace

8

F10

121

Caps Lock

20

F1

122

Ctrl

17

F12

123

Delete

46

Home

36

End

35

Insert

45

Enter

13

Num Lock

144

Esc

27

(NumPad) -

109

F1

112

(NumPad) *

106

F2

113

(NumPad) .

110

F3

114

(NumPad) /

111

F4

115

(NumPad) +

107

(NumPad) 0

96

P

80

NumPad) 1

97

Q

81

(NumPad) 2

98

R

82

NumPad) 3

99

S

83

(NumPad) 4

100

T

84

(NumPad) 5

101

U

85

(NumPad) 6

102

V

86

(NumPad) 7

103

W

87

(NumPad) 8

104

X

88

(NumPad) 9

105

Y

89

Page Down

34

Z

90

Page Up

33

1

49

Pause

19

2

50

Print Scrn

44

3

51

Scroll Lock

145

4

52

Shift

16

5

53

Spacebar

32

6

54

Tab

9

7

55

A

65

8

56

B

66

9

57

C

67

0

48

D

68

'

222

E

69

-

189

F

70

,

188

G

71

.

190

H

72

/

191

I

73

;

186

J

74

[

219

K

75

\

220

L

76

]

221

M

77

'

192

N

78

=

187

O

79

  
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JavaScript & DHTML Cookbook

JavaScript & DHTML Cookbook

Danny Goodman

Publisher Resources

ISBN: 9780596514082Errata Page