AS 3 charCodes
Posted by Fredrik
For everyone looking for the char codes corresponding to the keys on your keyboard when programming Flash / Flex, here they are!
A : uint = 65
ALTERNATE : uint = 18
B : uint = 66
BACKQUOTE : uint = 192
BACKSLASH : uint = 220
BACKSPACE : uint = 8
C : uint = 67
CAPS_LOCK : uint = 20
CharCodeStrings : Array
COMMA : uint = 188
COMMAND : uint = 15
CONTROL : uint = 17
D : uint = 68
DELETE : uint = 46
DOWN : uint = 40
E : uint = 69
END : uint = 35
ENTER : uint = 13
EQUAL : uint = 187
ESCAPE : uint = 27
F : uint = 70
F1 : uint = 112
F10 : uint = 121
F11 : uint = 122
F12 : uint = 123
F13 : uint = 124
F14 : uint = 125
F15 : uint = 126
F2 : uint = 113
F3 : uint = 114
F4 : uint = 115
F5 : uint = 116
F6 : uint = 117
F7 : uint = 118
F8 : uint = 119
F9 : uint = 120
G : uint = 71
H : uint = 72
HOME : uint = 36
I : uint = 73
INSERT : uint = 45
J : uint = 74
K : uint = 75
KEYNAME_BEGIN : String = “Begin”
KEYNAME_BREAK : String = “Break”
KEYNAME_CLEARDISPLAY : String = “ClrDsp”
KEYNAME_CLEARLINE : String = “ClrLn”
KEYNAME_DELETE : String = “Delete”
KEYNAME_DELETECHAR : String = “DelChr”
KEYNAME_DELETELINE : String = “DelLn”
KEYNAME_DOWNARROW : String = “Down”
KEYNAME_END : String = “End”
KEYNAME_EXECUTE : String = “Exec”
KEYNAME_F1 : String = “F1″
KEYNAME_F10 : String = “F10″
KEYNAME_F11 : String = “F11″
KEYNAME_F12 : String = “F12″
KEYNAME_F13 : String = “F13″
KEYNAME_F14 : String = “F14″
KEYNAME_F15 : String = “F15″
KEYNAME_F16 : String = “F16″
KEYNAME_F17 : String = “F17″
KEYNAME_F18 : String = “F18″
KEYNAME_F19 : String = “F19″
KEYNAME_F2 : String = “F2″
KEYNAME_F20 : String = “F20″
KEYNAME_F21 : String = “F21″
KEYNAME_F22 : String = “F22″
KEYNAME_F23 : String = “F23″
KEYNAME_F24 : String = “F24″
KEYNAME_F25 : String = “F25″
KEYNAME_F26 : String = “F26″
KEYNAME_F27 : String = “F27″
KEYNAME_F28 : String = “F28″
KEYNAME_F29 : String = “F29″
KEYNAME_F3 : String = “F3″
KEYNAME_F30 : String = “F30″
KEYNAME_F31 : String = “F31″
KEYNAME_F32 : String = “F32″
KEYNAME_F33 : String = “F33″
KEYNAME_F34 : String = “F34″
KEYNAME_F35 : String = “F35″
KEYNAME_F4 : String = “F4″
KEYNAME_F5 : String = “F5″
KEYNAME_F6 : String = “F6″
KEYNAME_F7 : String = “F7″
KEYNAME_F8 : String = “F8″
KEYNAME_F9 : String = “F9″
KEYNAME_FIND : String = “Find”
KEYNAME_HELP : String = “Help”
KEYNAME_HOME : String = “Home”
KEYNAME_INSERT : String = “Insert”
KEYNAME_INSERTCHAR : String = “InsChr”
KEYNAME_INSERTLINE : String = “InsLn”
KEYNAME_LEFTARROW : String = “Left”
KEYNAME_MENU : String = “Menu”
KEYNAME_MODESWITCH : String = “ModeSw”
KEYNAME_NEXT : String = “Next”
KEYNAME_PAGEDOWN : String = “PgDn”
KEYNAME_PAGEUP : String = “PgUp”
KEYNAME_PAUSE : String = “Pause”
KEYNAME_PREV : String = “Prev”
KEYNAME_PRINT : String = “Print”
KEYNAME_PRINTSCREEN : String = “PrntScrn”
KEYNAME_REDO : String = “Redo”
KEYNAME_RESET : String = “Reset”
KEYNAME_RIGHTARROW : String = “Right”
KEYNAME_SCROLLLOCK : String = “ScrlLck”
KEYNAME_SELECT : String = “Select”
KEYNAME_STOP : String = “Stop”
KEYNAME_SYSREQ : String = “SysReq”
KEYNAME_SYSTEM : String = “Sys”
KEYNAME_UNDO : String = “Undo”
KEYNAME_UPARROW : String = “Up”
KEYNAME_USER : String = “User”
L : uint = 76
LEFT : uint = 37
LEFTBRACKET : uint = 219
M : uint = 77
MINUS : uint = 189
N : uint = 78
NUMBER_0 : uint = 48
NUMBER_1 : uint = 49
NUMBER_2 : uint = 50
NUMBER_3 : uint = 51
NUMBER_4 : uint = 52
NUMBER_5 : uint = 53
NUMBER_6 : uint = 54
NUMBER_7 : uint = 55
NUMBER_8 : uint = 56
NUMBER_9 : uint = 57
NUMPAD : uint = 21
NUMPAD_0 : uint = 96
NUMPAD_1 : uint = 97
NUMPAD_2 : uint = 98
NUMPAD_3 : uint = 99
NUMPAD_4 : uint = 100
NUMPAD_5 : uint = 101
NUMPAD_6 : uint = 102
NUMPAD_7 : uint = 103
NUMPAD_8 : uint = 104
UMPAD_9 : uint = 105
NUMPAD_ADD : uint = 107
NUMPAD_DECIMAL : uint = 110
NUMPAD_DIVIDE : uint = 111
NUMPAD_ENTER : uint = 108
NUMPAD_MULTIPLY : uint = 106
NUMPAD_SUBTRACT : uint = 109
O : uint = 79
P : uint = 80
PAGE_DOWN : uint = 34
PAGE_UP : uint = 33
PERIOD : uint = 190
Q : uint = 81
QUOTE : uint = 222
R : uint = 82
RIGHT : uint = 39
RIGHTBRACKET : uint = 221
S : uint = 83
SEMICOLON : uint = 186
SHIFT : uint = 16
SLASH : uint = 191
SPACE : uint = 32
T : uint = 84
TAB : uint = 9
U : uint = 85
UP : uint = 38
V : uint = 86
W : uint = 87
X : uint = 88
Y : uint = 89
Z : uint = 90
For the swedes out there I also included the Swedish chars:
å : uint = 229
ä : uint = 228
ö : uint = 246
Å : uint = 197
Ä : uint = 196
Ö : uint = 214
If you have any more, Share!
10 Responses to “AS 3 charCodes”
-
Jameson Says:
September 1st, 2008 at 11:31 pmHey.. you are missing some chars.. what about all the non capital letters? Great resource anywho!
Cheers -
Stag night ideas Says:
January 27th, 2009 at 10:42 pmHi Fredrik,
Thanks for posting these – it saved me quite a lot of time & hassle
Cheers,
James -
Fredrik Says:
January 27th, 2009 at 10:49 pmNo worries, glad I could help. There are however some more in depth issues with the charCodes that I came across when working on different keyboard layouts. Lower case chars is also defined by their own charCodes. So A != a. Take care!
-
Ryan Davidson (rkd) Says:
March 18th, 2009 at 9:37 pmHuge thanks for this list, man. Adobe sucks complete ass for not having a simple table like that in their help documentation (and if they do, I couldn’t find it within 5 minutes so it is located somewhere that is NOT helpful).
-
andre Says:
May 28th, 2009 at 9:46 amthanks!! Flash doesn’t trace the Escape key and it sucks to create a textfield to print values under a browser.
thanks!
-
Jaime Says:
September 2nd, 2009 at 3:06 amOw yeah, Flash doesn’t trace the Escape key(and other keys that are shortcuts) because a conflict with player sandBox and the Flash interface; it understand that keys pressed is for the flash interface shortcuts. sucks
-
Paul Says:
September 24th, 2009 at 6:19 amVery handy utility! Thanks for sharing these char codes.
-
sam Says:
December 14th, 2009 at 5:23 amYou can also get the charcode with the charCodeAt function :
e.g.
“A”.charCodeAt(0)
-
Fredrik Says:
January 10th, 2010 at 2:27 amAhh.. thats a nice way to do it too
-
在线代理 Says:
July 17th, 2010 at 1:38 pm赞一个 文章写的挺好 支持一下
Lonely Duck HQ
Westin/Johansson Casa