There are three event on the document keyboard onkeypress onkeydown onkeyup each will return a keycode in integer.

keypressed keyvaluecounter on hold down     

 

 Here is the list of the number of the keyboard below and scroll down more for coding

key pressed

key code

 

key pressed

key code

 

key pressed

key code

 

A-Z key press

key code

Backspace

8

 

SPACE (new is blank)

32

 

1

97

 

a

65

Tab

9

 

page up

33

 

2

98

 

b

66

Enter

13

 

page down

34

 

3

99

 

c

67

Shift

16

 

end

35

 

4

100

 

d

68

Control

17

 

home

36

 

5

101

 

e

69

Alt

18

 

left-arrow

37

 

6

102

 

f

70

Pause

19

 

up-arrow

38

 

7

103

 

g

71

CapsLock

20

 

right-arrow

39

 

8

104

 

h

72

     

down-arrow

40

 

9

105

 

i

73

Escape

27

       

*

106

 

j

74

 

 

 

insert

45

 

+

107

 

k

75

NumLock

144

 

delete

46

       

l

76

ScrollLock

145

       

minus

109

 

m

77

' "

222

 

0!

48

 

decimal

110

 

n

78

[ {

219

 

1@

49

 

divide

111

 

o

79

] }

221

 

2#

50

 

F1

112

 

p

80

\ |

220

 

3$

51

 

F2

113

 

q

81

; :

186

 

4%

52

 

F3

114

 

r

82

= +

187

 

5^

53

 

F4

115

 

s

83

, <

188

 

6&

54

 

F5

116

 

t

84

- _

189

 

7*

55

 

F6

117

 

u

85

/ ?

190

 

8(

56

 

F7

118

 

v

86

. > 191  

9)

57

 

F8

119

 

w

87

` ~

192

       

F9

120

 

x

88

           

F10

121

 

y

89

           

F11

122

 

z

90

           

F12

123