|
1 //Key.java |
|
2 // |
|
3 // |
|
4 // |
|
5 |
|
6 package com.nokia.mj.impl.uitestutils; |
|
7 |
|
8 public class Key { |
|
9 |
|
10 // |
|
11 // NON UNICODE LOGICAL KEY CODES |
|
12 // pass them to class c.tor to generate symbian symbian scan and key codes |
|
13 // (for unicode keys use unicode char) |
|
14 // |
|
15 |
|
16 //non unicode MIDP key codes |
|
17 public static final int UpArrow = -1; |
|
18 public static final int DownArrow = -2; |
|
19 public static final int LeftArrow = -3; |
|
20 public static final int RightArrow = -4; |
|
21 public static final int Clear = -5; // Clear key |
|
22 public static final int Select = -6; // Selection key |
|
23 public static final int Edit = -7; // Edit Key |
|
24 public static final int Send = -8; // Send Key |
|
25 public static final int CBA1 = -9; // Left CBA |
|
26 public static final int CBA2 = -10; // Right CBA |
|
27 public static final int End = -11; // End key |
|
28 public static final int Applications = -12; // Applications key |
|
29 public static final int Voice = -13; // Voice key |
|
30 |
|
31 //non unicode non MIDP key codes |
|
32 public static final int Power = -14; |
|
33 public static final int Backspace = -15; |
|
34 public static final int GripOpen = -16; |
|
35 public static final int GripClose = -17; |
|
36 public static final int Camera = -18; |
|
37 public static final int VolumeUp = -19; |
|
38 public static final int VolumeDown = -20; |
|
39 public static final int PlayPause = -21; //Media key |
|
40 public static final int Stop = -22; //Media Key |
|
41 public static final int NextFF = -23; //Media key |
|
42 public static final int PreviousRew = -24; //Media key |
|
43 |
|
44 public static final int PageUp = -25; |
|
45 public static final int PageDown = -26; |
|
46 public static final int HomeKey = -27; |
|
47 public static final int EndKey = -28; |
|
48 // Activate key represents a key that will cause a "default selection" of an item. On Linux |
|
49 // this is Enter, but on S60 it may be the same key as Select. |
|
50 public static final int Activate = -29; |
|
51 public static final int InsertKey = -30; |
|
52 public static final int ReturnKey = -31; |
|
53 public static final int DeleteKey = -32; |
|
54 public static final int Escape = -33; |
|
55 |
|
56 |
|
57 |
|
58 // |
|
59 // SYMBIAN SCAN CODES - copied from e32keys.h |
|
60 // |
|
61 |
|
62 public static final int EStdKeyNull=0x00; /**< No key present. */ |
|
63 public static final int EStdKeyBackspace=0x01; /**< Scan code for Backspace key.*/ |
|
64 public static final int EStdKeyTab=0x02; /**< Scan code for Tab key. */ |
|
65 public static final int EStdKeyEnter=0x03; /**< Scan code for Enter key.*/ |
|
66 public static final int EStdKeyEscape=0x04; /**< Scan code for Escape (Esc) key.*/ |
|
67 public static final int EStdKeySpace=0x05; /**< Scan code for Space key.*/ |
|
68 public static final int EStdKeyPrintScreen=0x06; /**< Scan code for Print Screen key.*/ |
|
69 public static final int EStdKeyPause=0x07; /**< Scan code for Pause key.*/ |
|
70 public static final int EStdKeyHome=0x08; /**< Scan code for Home key.*/ |
|
71 public static final int EStdKeyEnd=0x09; /**< Scan code for End key.*/ |
|
72 public static final int EStdKeyPageUp=0x0a; /**< Scan code for Page Up key.*/ |
|
73 public static final int EStdKeyPageDown=0x0b; /**< Scan code for Page Down key.*/ |
|
74 public static final int EStdKeyInsert=0x0c; /**< Scan code for Insert key.*/ |
|
75 public static final int EStdKeyDelete=0x0d; /**< Scan code for Delete (Del) key.*/ |
|
76 public static final int EStdKeyLeftArrow=0x0e; /**< Scan code for Left arrow key.*/ |
|
77 public static final int EStdKeyRightArrow=0x0f; /**< Scan code for Right arrow key.*/ |
|
78 public static final int EStdKeyUpArrow=0x10; /**< Scan code for Up arrow key.*/ |
|
79 public static final int EStdKeyDownArrow=0x11; /**< Scan code for Down arrow key.*/ |
|
80 public static final int EStdKeyLeftShift=0x12; /**< Scan code for left Shift key.*/ |
|
81 public static final int EStdKeyRightShift=0x13; /**< Scan code for right Shift key.*/ |
|
82 public static final int EStdKeyLeftAlt=0x14; /**< Scan code for left Alt key.*/ |
|
83 public static final int EStdKeyRightAlt=0x15; /**< Scan code for right Alt key.*/ |
|
84 public static final int EStdKeyLeftCtrl=0x16; /**< Scan code for left Control (Ctrl) key.*/ |
|
85 public static final int EStdKeyRightCtrl=0x17; /**< Scan code for right Control (Ctrl) key.*/ |
|
86 public static final int EStdKeyLeftFunc=0x18; /**< Scan code for left Fn key.*/ |
|
87 public static final int EStdKeyRightFunc=0x19; /**< Scan code for right Fn key.*/ |
|
88 public static final int EStdKeyCapsLock=0x1a; /**< Scan code for Caps lock key.*/ |
|
89 public static final int EStdKeyNumLock=0x1b; /**< Scan code for Num lock key.*/ |
|
90 public static final int EStdKeyScrollLock=0x1c; /**< Scan code for Scroll lock key.*/ |
|
91 public static final int EStdKeyF1=0x60; /**< Scan code for function key F1.*/ |
|
92 public static final int EStdKeyF2=0x61; /**< Scan code for function key F2.*/ |
|
93 public static final int EStdKeyF3=0x62; /**< Scan code for function key F3.*/ |
|
94 public static final int EStdKeyF4=0x63; /**< Scan code for function key F4.*/ |
|
95 public static final int EStdKeyF5=0x64; /**< Scan code for function key F5*/ |
|
96 public static final int EStdKeyF6=0x65; /**< Scan code for function key F6*/ |
|
97 public static final int EStdKeyF7=0x66; /**< Scan code for function key F7*/ |
|
98 public static final int EStdKeyF8=0x67; /**< Scan code for function key F8*/ |
|
99 public static final int EStdKeyF9=0x68; /**< Scan code for function key F9*/ |
|
100 public static final int EStdKeyF10=0x69; /**< Scan code for function key F10*/ |
|
101 public static final int EStdKeyF11=0x6a; /**< Scan code for function key F11*/ |
|
102 public static final int EStdKeyF12=0x6b; /**< Scan code for function key F12*/ |
|
103 public static final int EStdKeyF13=0x6c; /**< Scan code for function key F13*/ |
|
104 public static final int EStdKeyF14=0x6d; /**< Scan code for function key F14*/ |
|
105 public static final int EStdKeyF15=0x6e; /**< Scan code for function key F15*/ |
|
106 public static final int EStdKeyF16=0x6f; /**< Scan code for function key F16*/ |
|
107 public static final int EStdKeyF17=0x70; /**< Scan code for function key F17*/ |
|
108 public static final int EStdKeyF18=0x71; /**< Scan code for function key F18*/ |
|
109 public static final int EStdKeyF19=0x72; /**< Scan code for function key F19*/ |
|
110 public static final int EStdKeyF20=0x73; /**< Scan code for function key F20*/ |
|
111 public static final int EStdKeyF21=0x74; /**< Scan code for function key F21*/ |
|
112 public static final int EStdKeyF22=0x75; /**< Scan code for function key F22.*/ |
|
113 public static final int EStdKeyF23=0x76; /**< Scan code for function key F23.*/ |
|
114 public static final int EStdKeyF24=0x77; /**< Scan code for function key F24.*/ |
|
115 public static final int EStdKeyXXX=0x78; /**< Scan code for the key to the left of the 1 key on a standard keyboard.*/ |
|
116 public static final int EStdKeyComma=0x79; /**< Scan code for Comma (,) key.*/ |
|
117 public static final int EStdKeyFullStop=0x7a; /**< Scan code for Full stop (.) key.*/ |
|
118 public static final int EStdKeyForwardSlash=0x7b; /**< Scan code for Forward slash (/) key.*/ |
|
119 public static final int EStdKeyBackSlash=0x7c; /**< Scan code for Back slash (\) key.*/ |
|
120 public static final int EStdKeySemiColon=0x7d; /**< Scan code for Semi colon (;) key.*/ |
|
121 public static final int EStdKeySingleQuote=0x7e; /**< Scan code for Single quote (') key.*/ |
|
122 public static final int EStdKeyHash=0x7f; /**< Scan code for Hash key (#) key.*/ |
|
123 public static final int EStdKeySquareBracketLeft=0x80; /**< Scan code for left Square bracket ([) key.*/ |
|
124 public static final int EStdKeySquareBracketRight=0x81; /**< Scan code for right Square bracket (]) key.*/ |
|
125 public static final int EStdKeyMinus=0x82; /**< Scan code for Minus key (-) key.*/ |
|
126 public static final int EStdKeyEquals=0x83; /**< Scan code for Equals key (=) key.*/ |
|
127 public static final int EStdKeyNkpForwardSlash=0x84; /**< Scan code for forward slash (/) key on the Numeric keypad.*/ |
|
128 public static final int EStdKeyNkpAsterisk=0x85; /**< Scan code for Asterisk (*) key on the Numeric keypad.*/ |
|
129 public static final int EStdKeyNkpMinus=0x86; /**< Scan code for Minus (-) key on the Numeric keypad.*/ |
|
130 public static final int EStdKeyNkpPlus=0x87; /**< Scan code for Plus (+) key on the Numeric keypad.*/ |
|
131 public static final int EStdKeyNkpEnter=0x88; /**< Scan code for Enter key on the Numeric keypad.*/ |
|
132 public static final int EStdKeyNkp1=0x89; /**< Scan code for the 1 key on the Numeric keypad.*/ |
|
133 public static final int EStdKeyNkp2=0x8a; /**< Scan code for the 2 key on the Numeric keypad.*/ |
|
134 public static final int EStdKeyNkp3=0x8b; /**< Scan code for the 3 key on the Numeric keypad.*/ |
|
135 public static final int EStdKeyNkp4=0x8c; /**< Scan code for the 4 key on the Numeric keypad.*/ |
|
136 public static final int EStdKeyNkp5=0x8d; /**< Scan code for the 5 key on the Numeric keypad.*/ |
|
137 public static final int EStdKeyNkp6=0x8e; /**< Scan code for the 6 key on the Numeric keypad.*/ |
|
138 public static final int EStdKeyNkp7=0x8f; /**< Scan code for the 7 key on the Numeric keypad.*/ |
|
139 public static final int EStdKeyNkp8=0x90; /**< Scan code for the 8 key on the Numeric keypad.*/ |
|
140 public static final int EStdKeyNkp9=0x91; /**< Scan code for the 9 key on the Numeric keypad.*/ |
|
141 public static final int EStdKeyNkp0=0x92; /**< Scan code for the 0 key on the Numeric keypad.*/ |
|
142 public static final int EStdKeyNkpFullStop=0x93; /**< Scan code for Full stop (.) key on the Numeric keypad.*/ |
|
143 public static final int EStdKeyMenu=0x94; /**< Scan code for Menu key.*/ |
|
144 public static final int EStdKeyBacklightOn=0x95; /**< Scan code for Backlight on key.*/ |
|
145 public static final int EStdKeyBacklightOff=0x96; /**< Scan code for Backlight off key.*/ |
|
146 public static final int EStdKeyBacklightToggle=0x97; /**< Scan code for Backlight toggle key.*/ |
|
147 public static final int EStdKeyIncContrast=0x98; /**< Scan code for Increase contrast key.*/ |
|
148 public static final int EStdKeyDecContrast=0x99; /**< Scan code for Decrease contrast key.*/ |
|
149 public static final int EStdKeySliderDown=0x9a; /**< Scan code for Slider down key.*/ |
|
150 public static final int EStdKeySliderUp=0x9b; /**< Scan code for Slider up key.*/ |
|
151 public static final int EStdKeyDictaphonePlay=0x9c; /**< Scan code for Dictaphone play key.*/ |
|
152 public static final int EStdKeyDictaphoneStop=0x9d; /**< Scan code for Dictaphone stop key.*/ |
|
153 public static final int EStdKeyDictaphoneRecord=0x9e; /**< Scan code for Dictaphone record key.*/ |
|
154 public static final int EStdKeyHelp=0x9f; /**< Scan code for Help key */ |
|
155 public static final int EStdKeyOff=0xa0; /**< Scan code for Off key.*/ |
|
156 public static final int EStdKeyDial=0xa1; /**< Scan code for Dial key.*/ |
|
157 public static final int EStdKeyIncVolume=0xa2; /**< Scan code for Increase volume key.*/ |
|
158 public static final int EStdKeyDecVolume=0xa3; /**< Scan code for Decrease volume key.*/ |
|
159 public static final int EStdKeyDevice0=0xa4; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
160 public static final int EStdKeyDevice1=0xa5; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
161 public static final int EStdKeyDevice2=0xa6; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
162 public static final int EStdKeyDevice3=0xa7; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
163 public static final int EStdKeyDevice4=0xa8; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
164 public static final int EStdKeyDevice5=0xa9; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
165 public static final int EStdKeyDevice6=0xaa; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
166 public static final int EStdKeyDevice7=0xab; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
167 public static final int EStdKeyDevice8=0xac; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
168 public static final int EStdKeyDevice9=0xad; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
169 public static final int EStdKeyDeviceA=0xae; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
170 public static final int EStdKeyDeviceB=0xaf; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
171 public static final int EStdKeyDeviceC=0xb0; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
172 public static final int EStdKeyDeviceD=0xb1; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
173 public static final int EStdKeyDeviceE=0xb2; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
174 public static final int EStdKeyDeviceF=0xb3; /**< Device-specific scan code - usually represents an extra hardware key on the phone.*/ |
|
175 public static final int EStdKeyApplication0=0xb4; /**< Scan code for device-specific application launcher key.*/ |
|
176 public static final int EStdKeyApplication1=0xb5; /**< Scan code for device-specific application launcher key.*/ |
|
177 public static final int EStdKeyApplication2=0xb6; /**< Scan code for device-specific application launcher key.*/ |
|
178 public static final int EStdKeyApplication3=0xb7; /**< Scan code for device-specific application launcher key.*/ |
|
179 public static final int EStdKeyApplication4=0xb8; /**< Scan code for device-specific application launcher key.*/ |
|
180 public static final int EStdKeyApplication5=0xb9; /**< Scan code for device-specific application launcher key.*/ |
|
181 public static final int EStdKeyApplication6=0xba; /**< Scan code for device-specific application launcher key.*/ |
|
182 public static final int EStdKeyApplication7=0xbb; /**< Scan code for device-specific application launcher key.*/ |
|
183 public static final int EStdKeyApplication8=0xbc; /**< Scan code for device-specific application launcher key.*/ |
|
184 public static final int EStdKeyApplication9=0xbd; /**< Scan code for device-specific application launcher key.*/ |
|
185 public static final int EStdKeyApplicationA=0xbe; /**< Scan code for device-specific application launcher key.*/ |
|
186 public static final int EStdKeyApplicationB=0xbf; /**< Scan code for device-specific application launcher key.*/ |
|
187 public static final int EStdKeyApplicationC=0xc0; /**< Scan code for device-specific application launcher key.*/ |
|
188 public static final int EStdKeyApplicationD=0xc1; /**< Scan code for device-specific application launcher key.*/ |
|
189 public static final int EStdKeyApplicationE=0xc2; /**< Scan code for device-specific application launcher key.*/ |
|
190 public static final int EStdKeyApplicationF=0xc3; /**< Scan code for device-specific application launcher key.*/ |
|
191 public static final int EStdKeyYes=0xc4; /**< Scan code for Yes key.*/ |
|
192 public static final int EStdKeyNo=0xc5; /**< Scan code for No key.*/ |
|
193 public static final int EStdKeyIncBrightness=0xc6; /**< Scan code for Increase brightness key.*/ |
|
194 public static final int EStdKeyDecBrightness=0xc7; /**< Scan code for Decrease brightness key.*/ |
|
195 public static final int EStdKeyKeyboardExtend=0xc8; /**< Scan code for flip actuated when keypad extends to full keyboard.*/ |
|
196 public static final int EStdKeyDevice10 = 0xc9; /**< Diagonal LeftUpArrow.*/ |
|
197 public static final int EStdKeyDevice11 = 0xca; /**< Diagonal RightUpArrow.*/ |
|
198 public static final int EStdKeyDevice12 = 0xcb; /**< Diagonal RightDownArrow.*/ |
|
199 public static final int EStdKeyDevice13 = 0xcc; /**< Diagonal LeftDownArrow.*/ |
|
200 |
|
201 // |
|
202 // SYMBIAN KEY CODES |
|
203 // |
|
204 |
|
205 public static final int ENonCharacterKeyBase = 0xf800; |
|
206 |
|
207 public static final int EKeyNull=0x0000; /**< Code for the Null key. */ |
|
208 public static final int EKeyBell=0x0007; /**< Code for the Bell key*/ |
|
209 public static final int EKeyBackspace=0x0008; /**< Code for the Backspace key */ |
|
210 public static final int EKeyTab=0x0009; /**< Code for the Tab key*/ |
|
211 public static final int EKeyLineFeed=0x000a; /**< Code for the Linefeed key*/ |
|
212 public static final int EKeyVerticalTab=0x000b; /**< Code for the Vertical tab key*/ |
|
213 public static final int EKeyFormFeed=0x000c; /**< Code for the Form feed key*/ |
|
214 public static final int EKeyEnter=0x000d; /**< Code for the Enter key */ |
|
215 public static final int EKeyEscape=0x001b; /**< Code for the Escape key */ |
|
216 public static final int EKeySpace=0x0020; /**< Code for the Space key*/ |
|
217 public static final int EKeyDelete=0x007f; /**< Code for the Delete (Del) key*/ |
|
218 public static final int EKeyPrintScreen = ENonCharacterKeyBase;/**< Code for the Print screen key */ |
|
219 public static final int EKeyPause = ENonCharacterKeyBase + 1; /**< Code for the Pause key*/ |
|
220 public static final int EKeyHome = ENonCharacterKeyBase + 2; /**< Code for the Home key*/ |
|
221 public static final int EKeyEnd = ENonCharacterKeyBase + 3; /**< Code for the End key*/ |
|
222 public static final int EKeyPageUp = ENonCharacterKeyBase + 4; /**< Code for the Page up key*/ |
|
223 public static final int EKeyPageDown = ENonCharacterKeyBase + 5; /**< Code for the Page down key*/ |
|
224 public static final int EKeyInsert = ENonCharacterKeyBase + 6; /**< Code for the Insert key*/ |
|
225 public static final int EKeyLeftArrow = ENonCharacterKeyBase + 7; /**< Code for the Left arrow key*/ |
|
226 public static final int EKeyRightArrow = ENonCharacterKeyBase + 8; /**< Code for the Right arrow key*/ |
|
227 public static final int EKeyUpArrow = ENonCharacterKeyBase + 9; /**< Code for the Up arrow key*/ |
|
228 public static final int EKeyDownArrow = ENonCharacterKeyBase + 10; /**< Code for the Down arrow key*/ |
|
229 public static final int EKeyLeftShift = ENonCharacterKeyBase + 11; /**< Code for the left Shift key*/ |
|
230 public static final int EKeyRightShift = ENonCharacterKeyBase + 12; /**< Code for the right Shift key*/ |
|
231 public static final int EKeyLeftAlt = ENonCharacterKeyBase + 13; /**< Code for the left Alt key*/ |
|
232 public static final int EKeyRightAlt = ENonCharacterKeyBase + 14; /**< Code for the right Alt key*/ |
|
233 public static final int EKeyLeftCtrl = ENonCharacterKeyBase + 15; /**< Code for the left Control (Ctrl) key*/ |
|
234 public static final int EKeyRightCtrl = ENonCharacterKeyBase + 16; /**< Code for the right Control (Ctrl) key.*/ |
|
235 public static final int EKeyLeftFunc = ENonCharacterKeyBase + 17; /**< Code for the left Fn key.*/ |
|
236 public static final int EKeyRightFunc = ENonCharacterKeyBase + 18; /**< Code for the right Fn key.*/ |
|
237 public static final int EKeyCapsLock = ENonCharacterKeyBase + 19; /**< Code for the Caps lock key.*/ |
|
238 public static final int EKeyNumLock = ENonCharacterKeyBase + 20; /**< Code for the Num lock key.*/ |
|
239 public static final int EKeyScrollLock = ENonCharacterKeyBase + 21; /**< Code for the Scroll lock key.*/ |
|
240 public static final int EKeyF1 = ENonCharacterKeyBase + 22; /**< Code for the F1 function key.*/ |
|
241 public static final int EKeyF2 = ENonCharacterKeyBase + 23; /**< Code for the F2 function key.*/ |
|
242 public static final int EKeyF3 = ENonCharacterKeyBase + 24; /**< Code for the F3 function key.*/ |
|
243 public static final int EKeyF4 = ENonCharacterKeyBase + 25; /**< Code for the F4 function key.*/ |
|
244 public static final int EKeyF5 = ENonCharacterKeyBase + 26; /**< Code for the F5 function key.*/ |
|
245 public static final int EKeyF6 = ENonCharacterKeyBase + 27; /**< Code for the F6 function key.*/ |
|
246 public static final int EKeyF7 = ENonCharacterKeyBase + 28; /**< Code for the F7 function key.*/ |
|
247 public static final int EKeyF8 = ENonCharacterKeyBase + 29; /**< Code for the F8 function key.*/ |
|
248 public static final int EKeyF9 = ENonCharacterKeyBase + 30; /**< Code for the F9 function key.*/ |
|
249 public static final int EKeyF10 = ENonCharacterKeyBase + 31; /**< Code for the F10 function key.*/ |
|
250 public static final int EKeyF11 = ENonCharacterKeyBase + 21; /**< Code for the F11 function key.*/ |
|
251 public static final int EKeyF12 = ENonCharacterKeyBase + 33; /**< Code for the F12 function key.*/ |
|
252 public static final int EKeyF13 = ENonCharacterKeyBase + 34; /**< Code for the F13 function key.*/ |
|
253 public static final int EKeyF14 = ENonCharacterKeyBase + 35; /**< Code for the F14 function key.*/ |
|
254 public static final int EKeyF15 = ENonCharacterKeyBase + 36; /**< Code for the F15 function key.*/ |
|
255 public static final int EKeyF16 = ENonCharacterKeyBase + 37; /**< Code for the F16 function key.*/ |
|
256 public static final int EKeyF17 = ENonCharacterKeyBase + 38; /**< Code for the F17 function key.*/ |
|
257 public static final int EKeyF18 = ENonCharacterKeyBase + 39; /**< Code for the F18 function key.*/ |
|
258 public static final int EKeyF19 = ENonCharacterKeyBase + 40; /**< Code for the F19 function key.*/ |
|
259 public static final int EKeyF20 = ENonCharacterKeyBase + 41; /**< Code for the F20 function key.*/ |
|
260 public static final int EKeyF21 = ENonCharacterKeyBase + 42; /**< Code for the F21 function key.*/ |
|
261 public static final int EKeyF22 = ENonCharacterKeyBase + 43; /**< Code for the F22 function key.*/ |
|
262 public static final int EKeyF23 = ENonCharacterKeyBase + 44; /**< Code for the F23 function key.*/ |
|
263 public static final int EKeyF24 = ENonCharacterKeyBase + 45; /**< Code for the F24 function key.*/ |
|
264 public static final int EKeyOff = ENonCharacterKeyBase + 46; /**< Code for the Off key.*/ |
|
265 public static final int EKeyIncContrast = ENonCharacterKeyBase + 47; /**< Code for the Increase contrast key.*/ |
|
266 public static final int EKeyDecContrast = ENonCharacterKeyBase + 48; /**< Code for the Decrease contrast key.*/ |
|
267 public static final int EKeyBacklightOn = ENonCharacterKeyBase + 49; /**< Code for the Backlight on key.*/ |
|
268 public static final int EKeyBacklightOff = ENonCharacterKeyBase + 50; /**< Code for the Backlight off key.*/ |
|
269 public static final int EKeyBacklightToggle = ENonCharacterKeyBase + 51; /**< Code for the Backlight toggle key.*/ |
|
270 public static final int EKeySliderDown = ENonCharacterKeyBase + 52; /**< Code for the Slider down key.*/ |
|
271 public static final int EKeySliderUp = ENonCharacterKeyBase + 53; /**< Code for the Slider up key.*/ |
|
272 public static final int EKeyMenu = ENonCharacterKeyBase + 54; /**< Code for the Menu key.*/ |
|
273 public static final int EKeyDictaphonePlay = ENonCharacterKeyBase + 55; /**< Code for the Dictaphone play key.*/ |
|
274 public static final int EKeyDictaphoneStop = ENonCharacterKeyBase + 56; /**< Code for the Dictaphone stop key.*/ |
|
275 public static final int EKeyDictaphoneRecord = ENonCharacterKeyBase + 57; /**< Code for the Dictaphone record key.*/ |
|
276 public static final int EKeyHelp = ENonCharacterKeyBase + 58; /**< Code for the Help key.*/ |
|
277 public static final int EKeyDial = ENonCharacterKeyBase + 59; /**< Code for the Dial key.*/ |
|
278 public static final int EKeyScreenDimension0 = ENonCharacterKeyBase + 60; /**< Code for the first Screen dimension change key.*/ |
|
279 public static final int EKeyScreenDimension1 = ENonCharacterKeyBase + 61; /**< Code for the second Screen dimension change key.*/ |
|
280 public static final int EKeyScreenDimension2 = ENonCharacterKeyBase + 62; /**< Code for the third Screen dimension change key.*/ |
|
281 public static final int EKeyScreenDimension3 = ENonCharacterKeyBase + 63; /**< Code for the fourth Screen dimension change key.*/ |
|
282 public static final int EKeyIncVolume = ENonCharacterKeyBase + 64; /**< Code for the increase colume key.*/ |
|
283 public static final int EKeyDecVolume = ENonCharacterKeyBase + 65; /**< Code for the decrease volume key.*/ |
|
284 public static final int EKeyDevice0 = ENonCharacterKeyBase + 66; /**< Code for a device specific key.*/ |
|
285 public static final int EKeyDevice1 = ENonCharacterKeyBase + 67; /**< Code for a device specific key.*/ |
|
286 public static final int EKeyDevice2 = ENonCharacterKeyBase + 68; /**< Code for a device specific key. */ |
|
287 public static final int EKeyDevice3 = ENonCharacterKeyBase + 69; /**< Code for a device specific key.*/ |
|
288 public static final int EKeyDevice4 = ENonCharacterKeyBase + 70; /**< Code for a device specific key.*/ |
|
289 public static final int EKeyDevice5 = ENonCharacterKeyBase + 71; /**< Code for a device specific key.*/ |
|
290 public static final int EKeyDevice6 = ENonCharacterKeyBase + 72; /**< Code for a device specific key.*/ |
|
291 public static final int EKeyDevice7 = ENonCharacterKeyBase + 73; /**< Code for a device specific key.*/ |
|
292 public static final int EKeyDevice8 = ENonCharacterKeyBase + 74; /**< Code for a device specific key.*/ |
|
293 public static final int EKeyDevice9 = ENonCharacterKeyBase + 75; /**< Code for a device specific key.*/ |
|
294 public static final int EKeyDeviceA = ENonCharacterKeyBase + 76; /**< Code for a device specific key.*/ |
|
295 public static final int EKeyDeviceB = ENonCharacterKeyBase + 77; /**< Code for a device specific key.*/ |
|
296 public static final int EKeyDeviceC = ENonCharacterKeyBase + 78; /**< Code for a device specific key.*/ |
|
297 public static final int EKeyDeviceD = ENonCharacterKeyBase + 79; /**< Code for a device specific key.*/ |
|
298 public static final int EKeyDeviceE = ENonCharacterKeyBase + 80; /**< Code for a device specific key.*/ |
|
299 public static final int EKeyDeviceF = ENonCharacterKeyBase + 81; /**< Code for a device specific key.*/ |
|
300 public static final int EKeyApplication0 = ENonCharacterKeyBase + 82; /**< Code for an Application launcher key.*/ |
|
301 public static final int EKeyApplication1 = ENonCharacterKeyBase + 83; /**< Code for an Application launcher key.*/ |
|
302 public static final int EKeyApplication2 = ENonCharacterKeyBase + 84; /**< Code for an Application launcher key.*/ |
|
303 public static final int EKeyApplication3 = ENonCharacterKeyBase + 85; /**< Code for an Application launcher key.*/ |
|
304 public static final int EKeyApplication4 = ENonCharacterKeyBase + 86; /**< Code for an Application launcher key.*/ |
|
305 public static final int EKeyApplication5 = ENonCharacterKeyBase + 87; /**< Code for an Application launcher key.*/ |
|
306 public static final int EKeyApplication6 = ENonCharacterKeyBase + 88; /**< Code for an Application launcher key.*/ |
|
307 public static final int EKeyApplication7 = ENonCharacterKeyBase + 89; /**< Code for an Application launcher key.*/ |
|
308 public static final int EKeyApplication8 = ENonCharacterKeyBase + 90; /**< Code for an Application launcher key.*/ |
|
309 public static final int EKeyApplication9 = ENonCharacterKeyBase + 91; /**< Code for an Application launcher key.*/ |
|
310 public static final int EKeyApplicationA = ENonCharacterKeyBase + 92; /**< Code for an Application launcher key.*/ |
|
311 public static final int EKeyApplicationB = ENonCharacterKeyBase + 93; /**< Code for an Application launcher key.*/ |
|
312 public static final int EKeyApplicationC = ENonCharacterKeyBase + 94; /**< Code for an Application launcher key.*/ |
|
313 public static final int EKeyApplicationD = ENonCharacterKeyBase + 95; /**< Code for an Application launcher key.*/ |
|
314 public static final int EKeyApplicationE = ENonCharacterKeyBase + 96; /**< Code for an Application launcher key.*/ |
|
315 public static final int EKeyApplicationF = ENonCharacterKeyBase + 97; /**< Code for an Application launcher key.*/ |
|
316 public static final int EKeyYes = ENonCharacterKeyBase + 98; /**< Code for the Yes key.*/ |
|
317 public static final int EKeyNo = ENonCharacterKeyBase + 99; /**< Code for the No key.*/ |
|
318 public static final int EKeyIncBrightness = ENonCharacterKeyBase + 100; /**< Code for the increase brightness key.*/ |
|
319 public static final int EKeyDecBrightness = ENonCharacterKeyBase + 101; /**< Code for the decrease brightness key. */ |
|
320 public static final int EKeyKeyboardExtend = ENonCharacterKeyBase + 102; /**< Code for flip actuated when keypad extends to full keyboard.*/ |
|
321 public static final int EKeyDevice10 = ENonCharacterKeyBase + 103; /**< Diagonal LeftUpArrow.*/ |
|
322 public static final int EKeyDevice11 = ENonCharacterKeyBase + 104; /**< Diagonal RightUpArrow.*/ |
|
323 public static final int EKeyDevice12 = ENonCharacterKeyBase + 105; /**< Diagonal RightDownArrow.*/ |
|
324 public static final int EKeyDevice13 = ENonCharacterKeyBase + 106; /**< Diagonal LeftDownArrow.*/ |
|
325 |
|
326 /** map from logical key codes to symbian key codes |
|
327 * (index is logical key codes above with opposite sign) |
|
328 * */ |
|
329 private int logicalKeyCodes[] = { |
|
330 EKeyUpArrow, //UpArrow |
|
331 EKeyDownArrow,//DownArrow |
|
332 EKeyLeftArrow,//LeftArrow |
|
333 EKeyRightArrow,//RightArrow |
|
334 EStdKeyDelete, //Clear |
|
335 EKeyDevice3, //Select |
|
336 EKeyRightShift, //Edit |
|
337 EKeyYes, //Send |
|
338 EKeyDevice0, //CBA1 |
|
339 EKeyDevice1, //CBA2 |
|
340 EKeyNo, //End |
|
341 EKeyApplication0, //Applications |
|
342 EKeyDevice6, //Voice |
|
343 EKeyDevice7, //Power |
|
344 EKeyDelete, //Backspace |
|
345 EKeySliderDown, //GripOpen |
|
346 EKeySliderUp, //GripClose |
|
347 EKeyDevice7, //Camera |
|
348 EKeyIncVolume, //VolumeUp |
|
349 EKeyDecVolume, //VolumeDown |
|
350 EKeyApplication2, //PlayPause |
|
351 EKeyApplication3, //Stop |
|
352 EKeyApplication4, //NextFF |
|
353 EKeyApplication5, //PreviousRew |
|
354 EKeyPageUp, // PageUp |
|
355 EKeyPageDown, // PageDown |
|
356 EKeyHome, // HomeKey |
|
357 EKeyEnd, // EndKey |
|
358 EKeyDevice3, // Activate |
|
359 EKeyInsert, // InsertKey |
|
360 EKeyEnter, // ReturnKey |
|
361 EKeyDelete, // DeleteKey |
|
362 EKeyEscape, // Escape |
|
363 EKeyDevice10, //Diagonal LeftUpArrow |
|
364 EKeyDevice11, //Diagonal RightUpArrow |
|
365 EKeyDevice12, //Diagonal RightDownArrow |
|
366 EKeyDevice13 //Diagonal LeftDownArrow |
|
367 }; |
|
368 |
|
369 /** map from logical key codes to symbian scan codes |
|
370 * (index is logical key codes above with opposite sign) |
|
371 * */ |
|
372 private int logicalScanCodes[] = { |
|
373 EStdKeyUpArrow, //UpArrow |
|
374 EStdKeyDownArrow, //DownArrow |
|
375 EStdKeyLeftArrow, //LeftArrow |
|
376 EStdKeyRightArrow, //RightArrow |
|
377 EStdKeyBackspace, //Clear |
|
378 EStdKeyDevice3, //Select |
|
379 EStdKeyRightShift, //Edit |
|
380 EStdKeyYes, //Send |
|
381 EStdKeyDevice0, //CBA1 |
|
382 EStdKeyDevice1, //CBA2 |
|
383 EStdKeyNo, //End |
|
384 EStdKeyApplication0, //Applications |
|
385 EStdKeyDevice6, //Voice |
|
386 EStdKeyDevice2, //Power |
|
387 EStdKeyBackspace, //Backspace |
|
388 EStdKeyNull, //GripOpen //TODO |
|
389 EStdKeyNull, //GripClose //TODO |
|
390 EStdKeyDevice7, //Camera |
|
391 EStdKeyIncVolume, //VolumeUp |
|
392 EStdKeyDecVolume, //VolumeDown |
|
393 EStdKeyApplication2, //PlayPause |
|
394 EStdKeyApplication3, //Stop |
|
395 EStdKeyApplication4, //NextFF |
|
396 EStdKeyApplication5, //PreviousRew |
|
397 EStdKeyPageUp,// PageUp |
|
398 EStdKeyPageDown,// PageDown |
|
399 EStdKeyHome,// HomeKey |
|
400 EStdKeyEnd,// EndKey |
|
401 EStdKeyDevice3,// Activate |
|
402 EStdKeyInsert,// InsertKey |
|
403 EStdKeyEnter,// ReturnKey |
|
404 EStdKeyDelete,// DeleteKey |
|
405 EStdKeyEscape,// Escape |
|
406 EStdKeyDevice10, //Diagonal LeftUpArrow |
|
407 EStdKeyDevice11, //Diagonal RightUpArrow |
|
408 EStdKeyDevice12, //Diagonal RightDownArrow |
|
409 EStdKeyDevice13 //Diagonal LeftDownArrow |
|
410 |
|
411 |
|
412 }; |
|
413 |
|
414 /** Default constructor */ |
|
415 public Key() { |
|
416 this.keyCode = 0; |
|
417 this.scanCode = 0; |
|
418 } |
|
419 |
|
420 /** Constructor accepting symbian key and scan codes defined above */ |
|
421 public Key(int keyCode, int scanCode) { |
|
422 this.keyCode = keyCode; |
|
423 this.scanCode = scanCode; |
|
424 } |
|
425 |
|
426 /** Constructor accepting unicode or logical key codes defined above */ |
|
427 public Key(int keyCode) { |
|
428 //JDEBUG("Key: Converting logical code " + keyCode); |
|
429 |
|
430 if (keyCode < 0) { |
|
431 this.keyCode = logicalKeyCodes[-keyCode -1]; |
|
432 this.scanCode = logicalScanCodes[-keyCode -1]; |
|
433 } else if (keyCode >= 'a' && keyCode <= 'z') { |
|
434 this.keyCode = keyCode; |
|
435 this.scanCode = keyCode - 'a' + 'A'; |
|
436 } else if (keyCode == '*') { |
|
437 this.keyCode = keyCode; |
|
438 this.scanCode = EStdKeyNkpAsterisk; |
|
439 |
|
440 } else if (keyCode == '#') { |
|
441 this.keyCode = keyCode; |
|
442 this.scanCode = EStdKeyHash; |
|
443 } else if (keyCode == '/' || keyCode == '?') { |
|
444 this.keyCode = keyCode; |
|
445 this.scanCode = EStdKeyForwardSlash; |
|
446 } |
|
447 else if (keyCode == EKeyBackspace) { |
|
448 this.keyCode = keyCode; |
|
449 this.scanCode = EStdKeyBackspace; |
|
450 } |
|
451 else if (keyCode == EKeyEnter) { |
|
452 this.keyCode = keyCode; |
|
453 this.scanCode = EStdKeyEnter; |
|
454 } |
|
455 else if (keyCode == EKeyEscape) { |
|
456 this.keyCode = keyCode; |
|
457 this.scanCode = EStdKeyEscape; |
|
458 } |
|
459 else if (keyCode == EKeyDelete) { |
|
460 this.keyCode = keyCode; |
|
461 this.scanCode = EStdKeyDelete; |
|
462 } |
|
463 else if (keyCode == EKeyTab) { |
|
464 this.keyCode = keyCode; |
|
465 this.scanCode = EStdKeyTab; |
|
466 } |
|
467 else if (keyCode == '-' || keyCode == '_') { |
|
468 this.keyCode = keyCode; |
|
469 this.scanCode = EStdKeyMinus; |
|
470 } |
|
471 else if (keyCode == '=') { |
|
472 this.keyCode = keyCode; |
|
473 this.scanCode = EStdKeyEquals; |
|
474 } |
|
475 else if (keyCode == '+') { |
|
476 this.keyCode = keyCode; |
|
477 this.scanCode = EStdKeyNkpPlus; |
|
478 } |
|
479 else if (keyCode == ';' || keyCode == ':') { |
|
480 this.keyCode = keyCode; |
|
481 this.scanCode = EStdKeySemiColon; |
|
482 } |
|
483 else if (keyCode == '\'' || keyCode == '\"' ) { |
|
484 this.keyCode = keyCode; |
|
485 this.scanCode = EStdKeySingleQuote; |
|
486 } |
|
487 else if (keyCode >= '0' && keyCode <= '9') { |
|
488 this.keyCode = keyCode; |
|
489 this.scanCode = keyCode; |
|
490 } |
|
491 else if (keyCode == EKeySpace) { |
|
492 this.keyCode = keyCode; |
|
493 this.scanCode = EStdKeySpace; |
|
494 } |
|
495 else if (keyCode == DownArrow) { |
|
496 this.keyCode = keyCode; |
|
497 this.scanCode = EStdKeyDownArrow; |
|
498 } |
|
499 else if (keyCode == UpArrow) { |
|
500 this.keyCode = keyCode; |
|
501 this.scanCode = EStdKeyUpArrow; |
|
502 } |
|
503 else if (keyCode == LeftArrow) { |
|
504 this.keyCode = keyCode; |
|
505 this.scanCode = EStdKeyLeftArrow; |
|
506 } |
|
507 else if (keyCode == RightArrow) { |
|
508 this.keyCode = keyCode; |
|
509 this.scanCode = EStdKeyRightArrow; |
|
510 } |
|
511 else if (keyCode == ',') { |
|
512 this.keyCode = keyCode; |
|
513 this.scanCode = EStdKeyComma; |
|
514 } |
|
515 else if (keyCode == '.') { |
|
516 this.keyCode = keyCode; |
|
517 this.scanCode = EStdKeyFullStop; |
|
518 } else { |
|
519 this.keyCode = keyCode; |
|
520 this.scanCode = keyCode; |
|
521 } |
|
522 } |
|
523 |
|
524 /** The symbian key code */ |
|
525 public int keyCode; |
|
526 |
|
527 /** The symbian scan code */ |
|
528 public int scanCode; |
|
529 |
|
530 /** Modifiers, for compatibility with XlibUtils **/ |
|
531 public int modifiers; |
|
532 } |