Keyboard Scan Codes

Top  Previous  Next

The Keyboard Scan Codes are the actual codes generated by the hardware in the keyboard before they have been filtered by the computers BIOS and operating system. There is one scan code for each key, even keys like Shift, Control, and Alt. There is some variation in the scan codes between keyboard manufacturers.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Esc

=

$0001

 

D

=

$0020

 

F6

=

$0040

 

F16

=

$0063

 

 

! 1

=

$0002

 

F

=

$0021

 

F7

=

$0041

 

F17

=

$0064

 

 

@ 2

=

$0003

 

G

=

$0022

 

F8

=

$0042

 

F18

=

$0065

 

 

# 3

=

$0004

 

H

=

$0023

 

F9

=

$0043

 

F19

=

$0066

 

 

$ 4

=

$0005

 

J

=

$0024

 

F10

=

$0044

 

F20

=

$0067

 

 

% 5

=

$0006

 

K

=

$0025

 

Pause Breakk

=

$0045

 

F21

=

$0068

 

 

^ 6

=

$0007

 

L

=

$0026

 

Scroll Lock

=

$0046

 

F22

=

$0069

 

 

& 7

=

$0008

 

: ;

=

$0027

 

7-Home (Keypad)

=

$0047

 

F23

=

$006A

 

 

* 8

=

$0009

 

" '

=

$0028

 

8 Up Arrow (Keypad)

=

$0048

 

F24

=

$006B

 

 

( 9

=

$000A

 

~ `

=

$0029

 

9 Page Up (Keypad)

=

$0049

 

Alt Right

=

$0138

 

 

) 0

=

$000B

 

Shift Left

=

$002A

 

- (Keypad)

=

$004A

 

Num Lock

=

$0145

 

 

_ -

=

$000C

 

| \

=

$002B

 

4 Left Arrow (Keypad)

=

$004B

 

Home

=

$0147

 

 

+ =

=

$000D

 

Z

=

$002C

 

5 (Keypad)

=

$004C

 

Up Arrow

=

$0148

 

 

Back Space

=

$000E

 

X

=

$002D

 

6 Right Arrow (Keypad)

=

$004D

 

Page Up

=

$0149

 

 

Tab

=

$000F

 

C

=

$002E

 

+ (Keypad)

=

$004E

 

Left Arrow

=

$014B

 

 

Q

=

$0010

 

V

=

$002F

 

1 End (Keypad)

=

$004F

 

Right Arrow

=

$014D

 

 

W

=

$0011

 

B

=

$0030

 

2 Down Arrow (Keypad)

=

$0050

 

End

=

$014F

 

 

E

=

$0012

 

N

=

$0031

 

3 PgDn (Keypad)

=

$0051

 

Down Arrow

=

$0150

 

 

R

=

$0013

 

M

=

$0032

 

0 Ins (Keypad)

=

$0052

 

Page Down

=

$0151

 

 

T

=

$0014

 

< ,

=

$0033

 

. Del (Keypad)

=

$0053

 

Ins

=

$0152

 

 

Y

=

$0015

 

> .

=

$0034

 

Sys Request

=

$0054

 

Del

=

$0153

 

 

U

=

$0016

 

? /

=

$0035

 

F11

=

$0057

 

Win Left

=

$015B

 

 

I

=

$0017

 

Shift Right

=

$0036

 

F12

=

$0058

 

Win Right

=

$015C

 

 

O

=

$0018

 

* (Keypad)

=

$0037

 

F13

=

$005B

 

Win Menu

=

$015D

 

 

P

=

$0019

 

Print Screen

=

$0037

 

F14

=

$005C

 

 

 

 

 

 

{ [

=

$001A

 

Alt Left

=

$0038

 

F15

=

$005D

 

 

 

 

 

 

} ]

=

$001B

 

Space

=

$0039

 

 

 

 

 

 

 

 

 

 

Enter

=

$001C

 

Caps Lock

=

$003A

 

 

 

 

 

 

 

 

 

 

Ctrl L

=

$001D

 

F1

=

$003B

 

 

 

 

 

 

 

 

 

 

A

=

$001E

 

F2

=

$003C

 

 

 

 

 

 

 

 

 

 

S

=

$001F

 

F3

=

$003D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F4

=

$003E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F5

=

$003F