Game Programming for Teens

[ LiB ]

Appendix A. SCAN CODE REFERENCE

This section contains a list of all the scan codes you can use for input in your programs. Scan codes are used in functions such as KeyHit() or KeyDown() , like this:

KeyDown(scancode)

Input the scan code for the key you want to test for, and the function will return 1 if the key was pressed.

Many of the following keys won't appear on your keyboard; some of them are international keys (like the symbol for the Yen) and some of them only exist on advanced keyboards that have extra keys (like the Calculator key). Anyway, you can find any key that you would ever think of using on this list.

Table Table A.1. The Scan Code Reference

Keyboard Key

Scan Code

Comments

ESC

1

 

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

10

11

Minus (-)

12

On Main Keyboard

Equals (=)

13

 

Backspace

14

Backspace Key

Tab

15

 

Q

16

W

17

E

18

R

19

T

20

Y

21

U

22

I

23

O

24

P

25

Left Bracket ([)

26

Right Bracket (])

27

Return/Enter

28

Return/Enter on Main Keyboard

Left Ctrl

29

 

A

30

S

31

D

32

F

33

G

34

H

35

J

36

K

37

 

L

38

Semicolon (;)

39

Apostrophe (')

40

Grave

41

Accent Grave

Left Shift

42

 

Backslash (\)

43

Z

44

X

45

C

46

V

47

B

48

N

49

M

50

Comma (,)

51

Period (.)

52

On Main Keyboard

Slash (/)

53

On Main Keyboard

Right Shift

54

 

Multiply (*)

55

On Numeric Keypad

Left Alt/Menu

56

 

Space

57

Caps Lock

58

F1

59

F2

60

F3

61

 

F4

62

F5

63

F6

64

F7

65

F8

66

F9

67

F10

68

NumLock

69

Scroll Lock

70

NumPad 7

71

NumPad 8

72

NumPad 9

73

Subtract (-)

74

On Numeric Keypad

NumPad 4

75

 

NumPad 5

76

NumPad 6

77

Add (+)

78

On Numeric Keypad

NumPad 1

79

 

NumPad 2

80

NumPad 3

81

NumPad 0

82

Decimal (.)

86

On Numeric Keypad

OEM_102

87

On UK/Germany Keyboards

Keyboard Key

Scan Code

Comments

F11

87

 

F12

88

 

F13

100

(NEC PC98)

F14

101

(NEC PC98)

F15

102

(NEC PC98)

Kana

112

Japanese Keyboard

ABNT_C1

115

/? On Portuguese (Brazilian) Keyboards

Convert

121

Japanese Keyboard

NoConvert

123

Japanese Keyboard

Yen

125

Japanese Keyboard

ABNT_C2

126

Numpad on Portuguese (Brazilian) Keyboards

Equals

141

= on Numeric Keypad (NEC PC98)

PrevTrack

144

Previous Track (DIK_CIRCUMFLEX) on Japanese Keyboard

AT

145

(NEX PC98)

Colon (:)

146

(NEC PC98)

Underline

147

(NEC PC98)

Kanji

148

Japanese Keyboard

Stop

149

(NEC PC98)

AX

150

Japan AX

Unlabeled

151

(J3100)

Next Track

153

Next Track

Enter

156

Enter on Numeric Keypad

Right Ctrl

157

 

Mute

160

Mute

Calculator

161

Calculator

Play/Pause

162

Play/Pause

Media Stop

164

Media Stop

Volume Down

174

Volume

Volume Up

176

Volume +

Web Home

178

Web Home

Comma (,)

179

On Numeric Keypad (NEX PC98)

Divide (/)

181

On Numeric Keypad

SysReq

183

 

Right Alt/Menu

184

Right Alt

Pause

197

Pause

Home

199

Home on Arrow Pad

Up

200

Up Arrow on Arrow Keypad

Page Up/Prior

201

Page Up on Arrow Keypad

Left

203

Left Arrow on Arrow Keypad

Right

205

Right Arrow on Arrow Keypad

End

207

End Key on Arrow Keypad

Down

208

Down Arrow on Arrow Keypad

Next

209

Next Key on Arrow Keypad

Insert

210

Insert Key on Arrow Keypad

Del

211

Delete Key on Arrow Keypad

Left Windows

219

Left Windows Key

Right Windows

220

Right Windows Key

Apps

221

Apps Menu Key

Power

222

System Power

Sleep

223

System Sleep

Wake

227

System Wake

Web Search

229

 

Web Favorites

230

Web Refresh

231

Web Stop

232

Web Forward

233

Web Back

234

My Computer

235

Mail

236

Media Select

237

[ LiB ]

Категории