O'Reilly    
 Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples


Latin 1 Character Repertoire and Keycodes: Appendix B - ActionScript for Flash MX

by Colin Moock

This excerpt is from ActionScript for Flash MX. ActionScript for Flash MX: The Definitive Guide is the most complete, up-to-date reference available for the latest version of ActionScript. Author Colin Moock has added hundreds of new code examples to show new Flash MX techniques in the real world. The book's language reference alone has nearly doubled from the first edition, with more than 250 new classes, objects, methods, and properties. You'll find exhaustive coverage of dozens of undocumented, under-documented, and mis-documented features.

buy button

Table B-1 lists the characters in the Latin 1 character repertoire, with Unicode equivalents in the range of U+0000 to U+00FF (that is, C0 Controls, Basic Latin, C1 Controls, and Latin 1 Supplemental). The table's first column (labeled Dec), lists each character's code point in decimal (the standard ASCII or Latin 1 value), the second column provides the Unicode escape sequence for the character, and the third column describes or shows the character itself. See Chapter 4, for more information on character encoding in Flash. Table B-2 and Table B-3 list the keycodes used with the Key object. Although there is some overlap, keycodes represent physical keys on the keyboard and have no direct relation to the Latin 1 characters listed in Table B-1. That said, you'll notice that the keycodes for letters and numbers, listed in Table B-3, are identical to the Latin 1 code points (and ASCII values) for the letters A-Z and the numbers 0-9. See Key.getCode( ) and the Key object in the ActionScript Language Reference for more information on keycodes.

For supplementary reading on the topic of character encoding, see the following resources:

A tutorial on character code issues

http://www.cs.tut.fi/~jkorpela/chars.html

A highly informative series of articles on character representation in computers. By Jukka Korpela.

Unicode FAQ

http://www.unicode.org/unicode/faq

A good question-and-answer format overview of Unicode, an international standard for character encoding.

To find the code point for a Unicode character not included in Latin 1, see:

Vendor Mappings

http://www.unicode.org/Public/MAPPINGS/VENDORS

Lists vendor-specific code pages with corresponding Unicode character code points. If you know the code page used for text entry on your computer, this will help you find the characters you can type.

Where is my character?

http://www.unicode.org/unicode/standard/where

A helpful document that suggests ways to track down a character in the Unicode character set.

Unicode Code Charts

http://www.unicode.org/charts

A collection of .pdf files that describe and visually depict the characters in Unicode.

Unihan Database

http://www.unicode.org/charts/unihan.html

The section of the Unicode Character Database that includes the code points for many Asian characters, including those in the Shift-JIS character set, Flash 5's supported set of Japanese characters.

Table B-1. ISO 8859-1 (Latin 1) characters and Unicode mappings

Dec

Unicode

Description

 

Dec

Unicode

Description

0

\u0000

[null]

 

19

\u0013

[device control three]

1

\u0001

[start of heading]

 

20

\u0014

[device control four]

2

\u0002

[start of text]

 

21

\u0015

[negative acknowledge]

3

\u0003

[end of text]

 

22

\u0016

[synchronous idle]

4

\u0004

[end of transmission]

 

23

\u0017

[end of transmission block]

5

\u0005

[enquiry]

 

24

\u0018

[cancel]

6

\u0006

[acknowledge]

 

25

\u0019

[end of medium]

7

\u0007

[bell]

 

26

\u001a

[substitute]

8

\u0008

[backspace]

 

27

\u001b

[escape]

9

\u0009

[horizontal tabulation]

 

28

\u001c

[file separator]

10

\u000a

[line feed]

 

29

\u001d

[group separator]

11

\u000b

[vertical tabulation]

 

30

\u001e

[record separator]

12

\u000c

[form feed]

 

31

\u001f

[unit separator]

13

\u000d

[carriage feed]

 

32

\u0020

[space]

14

\u000e

[shift out]

 

33

\u0021

!

15

\u000f

[shift in]

 

34

\u0022

" (straight quotes)

16

\u0010

[data link escape]

 

35

\u0023

#

17

\u0011

[device control one]

 

36

\u0024

$

18

\u0012

[device control two]

 

37

\u0025

%

38

\u0026

&

 

74

\u004a

J

39

\u0027

' (straight apostrophe)

 

75

\u004b

K

40

\u0028

(

 

76

\u004c

L

41

\u0029

)

 

77

\u004d

M

42

\u002a

*

 

78

\u004e

N

43

\u002b

+

 

79

\u004f

O

44

\u002c

, (comma)

 

80

\u0050

P

45

\u002d

- (minus)

 

81

\u0051

Q

46

\u002e

. (period)

 

82

\u0052

R

47

\u002f

/

 

83

\u0053

S

48

\u0030

0

 

84

\u0054

T

49

\u0031

1

 

85

\u0055

U

50

\u0032

2

 

86

\u0056

V

51

\u0033

3

 

87

\u0057

W

52

\u0034

4

 

88

\u0058

X

53

\u0035

5

 

89

\u0059

Y

54

\u0036

6

 

90

\u005a

Z

55

\u0037

7

 

91

\u005b

[

56

\u0038

8

 

92

\u005c

\

57

\u0039

9

 

93

\u005d

]

58

\u003a

:

 

94

\u005e

^

59

\u003b

;

 

95

\u005f

_ (underscore)

60

\u003c

<

 

96

\u0060

` (accent grave)

61

\u003d

=

 

97

\u0061

a

62

\u003e

>

 

98

\u0062

b

63

\u003f

?

 

99

\u0063

c

64

\u0040

@

 

100

\u0064

d

65

\u0041

A

 

101

\u0065

e

66

\u0042

B

 

102

\u0066

f

67

\u0043

C

 

103

\u0067

g

68

\u0044

D

 

104

\u0068

h

69

\u0045

E

 

105

\u0069

i

70

\u0046

F

 

106

\u006a

j

71

\u0047

G

 

107

\u006b

k

72

\u0048

H

 

108

\u006c

l

73

\u0049

I

 

109

\u006d

m

110

\u006e

n

 

146

\u0092

control chr

111

\u006f

o

 

147

\u0093

control chr

112

\u0070

p

 

148

\u0094

control chr

113

\u0071

q

 

149

\u0095

control chr

114

\u0072

r

 

150

\u0096

control chr

115

\u0073

s

 

151

\u0097

control chr

116

\u0074

t

 

152

\u0098

control chr

117

\u0075

u

 

153

\u0099

control chr

118

\u0076

v

 

154

\u009a

control chr

119

\u0077

w

 

155

\u009b

control chr

120

\u0078

x

 

156

\u009c

control chr

121

\u0079

y

 

157

\u009d

control chr

122

\u007a

z

 

158

\u009e

control chr

123

\u007b

{

 

159

\u009f

control chr

124

\u007c

|

 

160

\u00a0

[no break space]

125

\u007d

}

 

161

\u00a1

¡

126

\u007e

~

 

162

\u00a2

¢

127

\u007f

[delete]

 

163

\u00a3

£

128

\u0080

control chr

 

164

\u00a4

¤

129

\u0081

control chr

 

165

\u00a5

¥

130

\u0082

control chr

 

166

\u00a6

¦

131

\u0083

control chr

 

167

\u00a7

§

132

\u0084

control chr

 

168

\u00a8

¨

133

\u0085

control chr

 

169

\u00a9

©

134

\u0086

control chr

 

170

\u00aa

ª

135

\u0087

control chr

 

171

\u00ab

«

136

\u0088

control chr

 

172

\u00ac

¬

137

\u0089

control chr

 

173

\u00ad

-

138

\u008a

control chr

 

174

\u00ae

®

139

\u008b

control chr

 

175

\u00af

¯

140

\u008c

control chr

 

176

\u00b0

°

141

\u008d

control chr

 

177

\u00b1

±

142

\u008e

control chr

 

178

\u00b2

2

143

\u008f

control chr

 

179

\u00b3

3

144

\u0090

control chr

 

180

\u00b4

´

145

\u0091

control chr

 

181

\u00b5

μ

182

\u00b6

 

219

\u00db

û

183

\u00b7

 

220

\u00dc

Ü

184

\u00b8

¸

 

221

\u00dd

Ý

185

\u00b9

1

 

222

\u00de

Þ

186

\u00ba

º

 

223

\u00df

ß

187

\u00bb

»

 

224

\u00e0

à

188

\u00bc

1/4

 

225

\u00e1

á

189

\u00bd

1/2

 

226

\u00e2

â

190

\u00be

3/4

 

227

\u00e3

ã

191

\u00bf

¿

 

228

\u00e4

ä

192

\u00c0

À

 

229

\u00e5

å

193

\u00c1

Á

 

230

\u00e6

æ

194

\u00c2

¯

 

231

\u00e7

ç

195

\u00c3

Ã

 

232

\u00e8

è

196

\u00c4

Ä

 

233

\u00e9

é

197

\u00c5

Å

 

234

\u00ea

ê

198

\u00c6

Æ

 

235

\u00eb

ë

199

\u00c7

Ç

 

236

\u00ec

ì

200

\u00c8

È

 

237

\u00ed

í

201

\u00c9

É

 

238

\u00ee

î

202

\u00ca

Ê

 

239

\u00ef

ï

203

\u00cb

Ë

 

240

\u00f0

ð

204

\u00cc

Ì

 

241

\u00f1

ñ

205

\u00cd

Í

 

242

\u00f2

ò

206

\u00ce

Î

 

243

\u00f3

ó

207

\u00cf

Ï

 

244

\u00f4

ô

208

\u00d0

Ð

 

245

\u00f5

õ

209

\u00d1

Ñ

 

246

\u00f6

ö

210

\u00d2

Ò

 

247

\u00f7

÷

211

\u00d3

Ó

 

248

\u00f8

212

\u00d4

Ô

 

249

\u00f9

ù

213

\u00d5

Õ

 

250

\u00fa

ú

214

\u00d6

Ö

 

251

\u00fb

Û

215

\u00d7

×

 

252

\u00fc

ü

216

\u00d8

Ø

 

253

\u00fd

ý

217

\u00d9

Ù

 

254

\u00fe

þ

218

\u00da

Ú

 

255

\u00ff

ÿ


Table B-2 lists the keycodes for selected special keys on the keyboard. These keycodes are used only with the Key object. See Table 18-8 (under the Key object in the ActionScript Language Reference) for an alphabetical listing of the special properties.

Table B-2.  Key object special keycodes

Key

Keycode

Property

 

Key

Keycode

Backspace

8

Key.BACKSPACE

 

Num Pad 9

105

Tab

9

Key.TAB

 

Num Pad *

106

Enter

13

Key.ENTER

 

Num Pad +

107

Shift

16

Key.SHIFT

 

Num Pad Enter

13 (not trappable as 108)

Control

17

Key.CONTROL

 

Num Pad -

109

Alt

18 (not trappable)

   

Num Pad .

110

Pause/Break

19

   

Num Pad /

111

Caps Lock

20

Key.CAPSLOCK

 

F1

112

Escape

27

Key.ESCAPE

 

F2

113

Space

32

Key.SPACE

 

F3

114

Page Up

33

Key.PGUP

 

F4

115

Page Down

34

Key.PGDN

 

F5

116

End

35

Key.END

 

F6

117

Home

36

Key.HOME

 

F7

118

Left arrow

37

Key.LEFT

 

F8

119

Up Arrow

38

Key.UP

 

F9

120

Right Arrow

39

Key.RIGHT

 

F10

121 (not trappable)

Down arrow

40

Key.DOWN

 

F11

122

Print Screen

44

   

F12

123

Insert

45

Key.INSERT

 

Num Lock

144

Delete

46

Key.DELETEKEY

 

Scroll Lock

145

Num Pad 0

96

   

; :

186

Num Pad 1

97

   

+ =

187

Num Pad 2

98

   

- _

189

Num Pad 3

99

   

/ ?

191

Num Pad 4

100

   

` ~

192

Num Pad 5

101

   

[ {

219

Num Pad 6

102

   

\ |

220

Num Pad 7

103

   

] }

221

Num Pad 8

104

   

" '

222


Table B-3 lists the keycodes for the letter and number keys on a keyboard. These keycodes are used only with the Key object (see Key.getCode( ) and Key.isDown( ) in the ActionScript Language Reference).

Table B-3. Key object letter and number keycodes

Key

Keycode

 

Key

Keycode

 

Key

Keycode

A

65

 

M

77

 

Y

89

B

66

 

N

78

 

Z

90

C

67

 

O

79

 

0

48

D

68

 

P

80

 

1

49

E

69

 

Q

81

 

2

50

F

70

 

R

82

 

3

51

G

71

 

S

83

 

4

52

H

72

 

T

84

 

5

53

I

73

 

U

85

 

6

54

J

74

 

V

86

 

7

55

K

75

 

W

87

 

8

56

L

76

 

X

88

 

9

57

Copyright © 2009 O'Reilly Media, Inc.