|
1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // wins\specific\keymap.cpp |
|
15 // The lookup tables giving the function to be carried out |
|
16 // and the new state of the keyboard |
|
17 // |
|
18 // |
|
19 |
|
20 |
|
21 #include <k32keys.h> |
|
22 |
|
23 // the "array" parameter must be a true array and not a pointer |
|
24 #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) |
|
25 |
|
26 #define TABLE_ENTRY_ANOTHER_CTRL_DIGIT \ |
|
27 { \ |
|
28 { \ |
|
29 EModifierKeyUp|EModifierFunc, \ |
|
30 0 \ |
|
31 }, \ |
|
32 { \ |
|
33 EKeyNull, \ |
|
34 EAnyDigitGivenRadix \ |
|
35 }, \ |
|
36 { \ |
|
37 EStateCtrlDigits, \ |
|
38 EAddOnCtrlDigit, \ |
|
39 0 \ |
|
40 } \ |
|
41 } |
|
42 |
|
43 // This table is searched for a match if a match has not been |
|
44 // found in the current state's table |
|
45 |
|
46 LOCAL_D const SFuncTableEntry defaultTable[]= |
|
47 { |
|
48 { // prevent key up events generating keycodes |
|
49 { |
|
50 EModifierKeyUp, |
|
51 EModifierKeyUp |
|
52 }, |
|
53 { |
|
54 EKeyNull, |
|
55 EAnyKey |
|
56 }, |
|
57 { |
|
58 EStateUnchanged, |
|
59 EDoNothing, |
|
60 0 |
|
61 } |
|
62 }, |
|
63 { // prevent any modifer key from changing state |
|
64 { |
|
65 0, |
|
66 0 |
|
67 }, |
|
68 { |
|
69 EKeyNull, |
|
70 EAnyModifierKey |
|
71 }, |
|
72 { |
|
73 EStateUnchanged, |
|
74 EDoNothing, |
|
75 0 |
|
76 } |
|
77 }, |
|
78 { // filter out any unprocessed codes??? |
|
79 { |
|
80 0, |
|
81 0 |
|
82 }, |
|
83 { |
|
84 EKeyNull, |
|
85 EAnyKey |
|
86 }, |
|
87 { |
|
88 EStateNormal, |
|
89 EDoNothing, |
|
90 0 |
|
91 } |
|
92 } |
|
93 }; |
|
94 |
|
95 // The table indicating which keys change which modifiers; |
|
96 // the state field in this table is ignored |
|
97 LOCAL_D const SFuncTableEntry modifierTable[]= |
|
98 { |
|
99 { |
|
100 { |
|
101 EModifierKeyUp, |
|
102 0 |
|
103 }, |
|
104 { |
|
105 EKeyCapsLock, |
|
106 EMatchKey |
|
107 }, |
|
108 { |
|
109 EStateUnchanged, |
|
110 EToggleModifier, |
|
111 EModifierCapsLock |
|
112 } |
|
113 }, |
|
114 { |
|
115 { |
|
116 EModifierKeyUp, |
|
117 0 |
|
118 }, |
|
119 { |
|
120 EKeyNumLock, |
|
121 EMatchKey |
|
122 }, |
|
123 { |
|
124 EStateUnchanged, |
|
125 EToggleModifier, |
|
126 EModifierNumLock |
|
127 } |
|
128 }, |
|
129 { |
|
130 { |
|
131 EModifierKeyUp, |
|
132 0 |
|
133 }, |
|
134 { |
|
135 EKeyScrollLock, |
|
136 EMatchKey |
|
137 }, |
|
138 { |
|
139 EStateUnchanged, |
|
140 EToggleModifier, |
|
141 EModifierScrollLock |
|
142 } |
|
143 }, |
|
144 { |
|
145 { |
|
146 EModifierKeyUp, |
|
147 0 |
|
148 }, |
|
149 { |
|
150 EKeyLeftAlt, |
|
151 EMatchKey |
|
152 }, |
|
153 { |
|
154 EStateUnchanged, |
|
155 ETurnOnModifier, |
|
156 EModifierAlt|EModifierLeftAlt |
|
157 } |
|
158 }, |
|
159 { |
|
160 { |
|
161 EModifierKeyUp, |
|
162 EModifierKeyUp |
|
163 }, |
|
164 { |
|
165 EKeyLeftAlt, |
|
166 EMatchKey |
|
167 }, |
|
168 { |
|
169 EStateUnchanged, |
|
170 ETurnOffModifier, |
|
171 EModifierLeftAlt |
|
172 } |
|
173 }, |
|
174 { |
|
175 { |
|
176 EModifierKeyUp, |
|
177 0 |
|
178 }, |
|
179 { |
|
180 EKeyLeftFunc, |
|
181 EMatchKey |
|
182 }, |
|
183 { |
|
184 EStateUnchanged, |
|
185 ETurnOnModifier, |
|
186 EModifierFunc|EModifierLeftFunc |
|
187 } |
|
188 }, |
|
189 { |
|
190 { |
|
191 EModifierKeyUp, |
|
192 EModifierKeyUp |
|
193 }, |
|
194 { |
|
195 EKeyLeftFunc, |
|
196 EMatchKey |
|
197 }, |
|
198 { |
|
199 EStateUnchanged, |
|
200 ETurnOffModifier, |
|
201 EModifierLeftFunc |
|
202 } |
|
203 }, |
|
204 { |
|
205 { |
|
206 EModifierKeyUp, |
|
207 0 |
|
208 }, |
|
209 { |
|
210 EKeyLeftShift, |
|
211 EMatchKey |
|
212 }, |
|
213 { |
|
214 EStateUnchanged, |
|
215 ETurnOnModifier, |
|
216 EModifierShift|EModifierLeftShift |
|
217 } |
|
218 }, |
|
219 { |
|
220 { |
|
221 EModifierKeyUp, |
|
222 EModifierKeyUp |
|
223 }, |
|
224 { |
|
225 EKeyLeftShift, |
|
226 EMatchKey |
|
227 }, |
|
228 { |
|
229 EStateUnchanged, |
|
230 ETurnOffModifier, |
|
231 EModifierLeftShift |
|
232 } |
|
233 }, |
|
234 { |
|
235 { |
|
236 EModifierKeyUp, |
|
237 0 |
|
238 }, |
|
239 { |
|
240 EKeyLeftCtrl, |
|
241 EMatchKey |
|
242 }, |
|
243 { |
|
244 EStateUnchanged, |
|
245 ETurnOnModifier, |
|
246 EModifierCtrl|EModifierLeftCtrl |
|
247 } |
|
248 }, |
|
249 { |
|
250 { |
|
251 EModifierKeyUp, |
|
252 EModifierKeyUp |
|
253 }, |
|
254 { |
|
255 EKeyLeftCtrl, |
|
256 EMatchKey |
|
257 }, |
|
258 { |
|
259 EStateUnchanged, |
|
260 ETurnOffModifier, |
|
261 EModifierLeftCtrl |
|
262 } |
|
263 }, |
|
264 { |
|
265 { |
|
266 EModifierKeyUp, |
|
267 0 |
|
268 }, |
|
269 { |
|
270 EKeyRightAlt, |
|
271 EMatchKey |
|
272 }, |
|
273 { |
|
274 EStateUnchanged, |
|
275 ETurnOnModifier, |
|
276 EModifierAlt|EModifierRightAlt |
|
277 } |
|
278 }, |
|
279 { |
|
280 { |
|
281 EModifierKeyUp, |
|
282 EModifierKeyUp |
|
283 }, |
|
284 { |
|
285 EKeyRightAlt, |
|
286 EMatchKey |
|
287 }, |
|
288 { |
|
289 EStateUnchanged, |
|
290 ETurnOffModifier, |
|
291 EModifierRightAlt |
|
292 } |
|
293 }, |
|
294 { |
|
295 { |
|
296 EModifierKeyUp, |
|
297 0 |
|
298 }, |
|
299 { |
|
300 EKeyRightFunc, |
|
301 EMatchKey |
|
302 }, |
|
303 { |
|
304 EStateUnchanged, |
|
305 ETurnOnModifier, |
|
306 EModifierFunc|EModifierRightFunc |
|
307 } |
|
308 }, |
|
309 { |
|
310 { |
|
311 EModifierKeyUp, |
|
312 EModifierKeyUp |
|
313 }, |
|
314 { |
|
315 EKeyRightFunc, |
|
316 EMatchKey |
|
317 }, |
|
318 { |
|
319 EStateUnchanged, |
|
320 ETurnOffModifier, |
|
321 EModifierRightFunc |
|
322 } |
|
323 }, |
|
324 { |
|
325 { |
|
326 EModifierKeyUp, |
|
327 0 |
|
328 }, |
|
329 { |
|
330 EKeyRightShift, |
|
331 EMatchKey |
|
332 }, |
|
333 { |
|
334 EStateUnchanged, |
|
335 ETurnOnModifier, |
|
336 EModifierShift|EModifierRightShift |
|
337 } |
|
338 }, |
|
339 { |
|
340 { |
|
341 EModifierKeyUp, |
|
342 EModifierKeyUp |
|
343 }, |
|
344 { |
|
345 EKeyRightShift, |
|
346 EMatchKey |
|
347 }, |
|
348 { |
|
349 EStateUnchanged, |
|
350 ETurnOffModifier, |
|
351 EModifierRightShift |
|
352 } |
|
353 }, |
|
354 { |
|
355 { |
|
356 EModifierKeyUp, |
|
357 0 |
|
358 }, |
|
359 { |
|
360 EKeyRightCtrl, |
|
361 EMatchKey |
|
362 }, |
|
363 { |
|
364 EStateUnchanged, |
|
365 ETurnOnModifier, |
|
366 EModifierCtrl|EModifierRightCtrl |
|
367 } |
|
368 }, |
|
369 { |
|
370 { |
|
371 EModifierKeyUp, |
|
372 EModifierKeyUp |
|
373 }, |
|
374 { |
|
375 EKeyRightCtrl, |
|
376 EMatchKey |
|
377 }, |
|
378 { |
|
379 EStateUnchanged, |
|
380 ETurnOffModifier, |
|
381 EModifierRightCtrl |
|
382 } |
|
383 } |
|
384 }; |
|
385 |
|
386 // table0 to table12 are the tables corresponding to states |
|
387 // 0 to 12 respectively |
|
388 |
|
389 LOCAL_D const SFuncTableEntry table0[]= |
|
390 { |
|
391 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
392 }; |
|
393 |
|
394 LOCAL_D const SFuncTableEntry table1[]= |
|
395 { |
|
396 { |
|
397 { |
|
398 EModifierFunc|EModifierKeyUp, |
|
399 0 |
|
400 }, |
|
401 { |
|
402 'e', |
|
403 EMatchKeyCaseInsens |
|
404 }, |
|
405 { |
|
406 EStateNormal, |
|
407 EPassSpecialKeyThru, |
|
408 ELatin1LcAe |
|
409 } |
|
410 }, |
|
411 { |
|
412 { |
|
413 EModifierFunc|EModifierKeyUp, |
|
414 0 |
|
415 }, |
|
416 { |
|
417 'c', |
|
418 EMatchKeyCaseInsens |
|
419 }, |
|
420 { |
|
421 EStateNormal, |
|
422 EPassSpecialKeyThru, |
|
423 ELatin1LcCcedilla |
|
424 } |
|
425 }, |
|
426 { |
|
427 { |
|
428 EModifierFunc|EModifierKeyUp, |
|
429 0 |
|
430 }, |
|
431 { |
|
432 's', |
|
433 EMatchKeyCaseInsens |
|
434 }, |
|
435 { |
|
436 EStateNormal, |
|
437 EPassSpecialKeyThru, |
|
438 ELatin1EsTset |
|
439 } |
|
440 }, |
|
441 { |
|
442 { |
|
443 EModifierFunc|EModifierKeyUp, |
|
444 0 |
|
445 }, |
|
446 { |
|
447 'o', |
|
448 EMatchKeyCaseInsens |
|
449 }, |
|
450 { |
|
451 EStateNormal, |
|
452 EPassSpecialKeyThru, |
|
453 ELatin1LcOslash |
|
454 } |
|
455 }, |
|
456 { |
|
457 { |
|
458 EModifierFunc|EModifierKeyUp, |
|
459 0 |
|
460 }, |
|
461 { |
|
462 'd', |
|
463 EMatchKeyCaseInsens |
|
464 }, |
|
465 { |
|
466 EStateNormal, |
|
467 EPassSpecialKeyThru, |
|
468 ELatin1LcThorn |
|
469 } |
|
470 }, |
|
471 { |
|
472 { |
|
473 EModifierFunc|EModifierKeyUp, |
|
474 0 |
|
475 }, |
|
476 { |
|
477 't', |
|
478 EMatchKeyCaseInsens |
|
479 }, |
|
480 { |
|
481 EStateNormal, |
|
482 EPassSpecialKeyThru, |
|
483 ELatin1LcSoftTh |
|
484 } |
|
485 }, |
|
486 { |
|
487 { |
|
488 EModifierFunc|EModifierKeyUp, |
|
489 0 |
|
490 }, |
|
491 { |
|
492 'l', |
|
493 EMatchKeyCaseInsens |
|
494 }, |
|
495 { |
|
496 EStateNormal, |
|
497 EPassSpecialKeyThru, |
|
498 ELatin1LeftChevron |
|
499 } |
|
500 }, |
|
501 { |
|
502 { |
|
503 EModifierFunc|EModifierKeyUp, |
|
504 0 |
|
505 }, |
|
506 { |
|
507 'r', |
|
508 EMatchKeyCaseInsens |
|
509 }, |
|
510 { |
|
511 EStateNormal, |
|
512 EPassSpecialKeyThru, |
|
513 ELatin1RightChevron |
|
514 } |
|
515 }, |
|
516 { |
|
517 { |
|
518 EModifierFunc|EModifierKeyUp, |
|
519 0 |
|
520 }, |
|
521 { |
|
522 'x', |
|
523 EMatchKeyCaseInsens |
|
524 }, |
|
525 { |
|
526 EStateNormal, |
|
527 EPassSpecialKeyThru, |
|
528 ELatin1InvExclam |
|
529 } |
|
530 }, |
|
531 { |
|
532 { |
|
533 EModifierFunc|EModifierKeyUp, |
|
534 0 |
|
535 }, |
|
536 { |
|
537 'q', |
|
538 EMatchKeyCaseInsens |
|
539 }, |
|
540 { |
|
541 EStateNormal, |
|
542 EPassSpecialKeyThru, |
|
543 ELatin1InvQuest |
|
544 } |
|
545 }, |
|
546 { |
|
547 { |
|
548 EModifierFunc|EModifierKeyUp, |
|
549 0 |
|
550 }, |
|
551 { |
|
552 'a', |
|
553 EMatchKeyCaseInsens |
|
554 }, |
|
555 { |
|
556 EStateNormal, |
|
557 EPassSpecialKeyThru, |
|
558 ELatin1LcAo |
|
559 } |
|
560 }, |
|
561 { |
|
562 { |
|
563 EModifierFunc|EModifierKeyUp, |
|
564 0 |
|
565 }, |
|
566 { |
|
567 'p', |
|
568 EMatchKeyCaseInsens |
|
569 }, |
|
570 { |
|
571 EStateNormal, |
|
572 EPassSpecialKeyThru, |
|
573 ELatin1Pound |
|
574 } |
|
575 }, |
|
576 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
577 }; |
|
578 |
|
579 LOCAL_D const SFuncTableEntry table2[]= |
|
580 { |
|
581 { |
|
582 { |
|
583 EModifierFunc|EModifierKeyUp, |
|
584 0 |
|
585 }, |
|
586 { |
|
587 'a', |
|
588 EMatchKeyCaseInsens |
|
589 }, |
|
590 { |
|
591 EStateNormal, |
|
592 EPassSpecialKeyThru, |
|
593 ELatin1LcAumlaut |
|
594 } |
|
595 }, |
|
596 { |
|
597 { |
|
598 EModifierFunc|EModifierKeyUp, |
|
599 0 |
|
600 }, |
|
601 { |
|
602 'e', |
|
603 EMatchKeyCaseInsens |
|
604 }, |
|
605 { |
|
606 EStateNormal, |
|
607 EPassSpecialKeyThru, |
|
608 ELatin1LcEumlaut |
|
609 } |
|
610 }, |
|
611 { |
|
612 { |
|
613 EModifierFunc|EModifierKeyUp, |
|
614 0 |
|
615 }, |
|
616 { |
|
617 'i', |
|
618 EMatchKeyCaseInsens |
|
619 }, |
|
620 { |
|
621 EStateNormal, |
|
622 EPassSpecialKeyThru, |
|
623 ELatin1LcIumlaut |
|
624 } |
|
625 }, |
|
626 { |
|
627 { |
|
628 EModifierFunc|EModifierKeyUp, |
|
629 0 |
|
630 }, |
|
631 { |
|
632 'o', |
|
633 EMatchKeyCaseInsens |
|
634 }, |
|
635 { |
|
636 EStateNormal, |
|
637 EPassSpecialKeyThru, |
|
638 ELatin1LcOumlaut |
|
639 } |
|
640 }, |
|
641 { |
|
642 { |
|
643 EModifierFunc|EModifierKeyUp, |
|
644 0 |
|
645 }, |
|
646 { |
|
647 'u', |
|
648 EMatchKeyCaseInsens |
|
649 }, |
|
650 { |
|
651 EStateNormal, |
|
652 EPassSpecialKeyThru, |
|
653 ELatin1LcUumlaut |
|
654 } |
|
655 }, |
|
656 { |
|
657 { |
|
658 EModifierFunc|EModifierKeyUp, |
|
659 0 |
|
660 }, |
|
661 { |
|
662 'y', |
|
663 EMatchKeyCaseInsens |
|
664 }, |
|
665 { |
|
666 EStateNormal, |
|
667 EPassSpecialKeyThru, |
|
668 ELatin1LcYumlaut |
|
669 } |
|
670 }, |
|
671 { |
|
672 { |
|
673 EModifierFunc|EModifierKeyUp, |
|
674 0 |
|
675 }, |
|
676 { |
|
677 ' ', |
|
678 EMatchKey |
|
679 }, |
|
680 { |
|
681 EStateNormal, |
|
682 EPassSpecialKeyThru, |
|
683 ELatin1SpaceUmlaut |
|
684 } |
|
685 }, |
|
686 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
687 }; |
|
688 |
|
689 LOCAL_D const SFuncTableEntry table3[]= |
|
690 { |
|
691 { |
|
692 { |
|
693 EModifierFunc|EModifierKeyUp, |
|
694 0 |
|
695 }, |
|
696 { |
|
697 'a', |
|
698 EMatchKeyCaseInsens |
|
699 }, |
|
700 { |
|
701 EStateNormal, |
|
702 EPassSpecialKeyThru, |
|
703 ELatin1LcAgrave |
|
704 } |
|
705 }, |
|
706 { |
|
707 { |
|
708 EModifierFunc|EModifierKeyUp, |
|
709 0 |
|
710 }, |
|
711 { |
|
712 'e', |
|
713 EMatchKeyCaseInsens |
|
714 }, |
|
715 { |
|
716 EStateNormal, |
|
717 EPassSpecialKeyThru, |
|
718 ELatin1LcEgrave |
|
719 } |
|
720 }, |
|
721 { |
|
722 { |
|
723 EModifierFunc|EModifierKeyUp, |
|
724 0 |
|
725 }, |
|
726 { |
|
727 'i', |
|
728 EMatchKeyCaseInsens |
|
729 }, |
|
730 { |
|
731 EStateNormal, |
|
732 EPassSpecialKeyThru, |
|
733 ELatin1LcIgrave |
|
734 } |
|
735 }, |
|
736 { |
|
737 { |
|
738 EModifierFunc|EModifierKeyUp, |
|
739 0 |
|
740 }, |
|
741 { |
|
742 'o', |
|
743 EMatchKeyCaseInsens |
|
744 }, |
|
745 { |
|
746 EStateNormal, |
|
747 EPassSpecialKeyThru, |
|
748 ELatin1LcOgrave |
|
749 } |
|
750 }, |
|
751 { |
|
752 { |
|
753 EModifierFunc|EModifierKeyUp, |
|
754 0 |
|
755 }, |
|
756 { |
|
757 'u', |
|
758 EMatchKeyCaseInsens |
|
759 }, |
|
760 { |
|
761 EStateNormal, |
|
762 EPassSpecialKeyThru, |
|
763 ELatin1LcUgrave |
|
764 } |
|
765 }, |
|
766 { |
|
767 { |
|
768 EModifierFunc|EModifierKeyUp, |
|
769 0 |
|
770 }, |
|
771 { |
|
772 ' ', |
|
773 EMatchKey |
|
774 }, |
|
775 { |
|
776 EStateNormal, |
|
777 EPassSpecialKeyThru, |
|
778 ELatin1SpaceGrave |
|
779 } |
|
780 }, |
|
781 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
782 }; |
|
783 |
|
784 LOCAL_D const SFuncTableEntry table4[]= |
|
785 { |
|
786 { |
|
787 { |
|
788 EModifierFunc|EModifierKeyUp, |
|
789 0 |
|
790 }, |
|
791 { |
|
792 'a', |
|
793 EMatchKeyCaseInsens |
|
794 }, |
|
795 { |
|
796 EStateNormal, |
|
797 EPassSpecialKeyThru, |
|
798 ELatin1LcAacute |
|
799 } |
|
800 }, |
|
801 { |
|
802 { |
|
803 EModifierFunc|EModifierKeyUp, |
|
804 0 |
|
805 }, |
|
806 { |
|
807 'e', |
|
808 EMatchKeyCaseInsens |
|
809 }, |
|
810 { |
|
811 EStateNormal, |
|
812 EPassSpecialKeyThru, |
|
813 ELatin1LcEacute |
|
814 } |
|
815 }, |
|
816 { |
|
817 { |
|
818 EModifierFunc|EModifierKeyUp, |
|
819 0 |
|
820 }, |
|
821 { |
|
822 'i', |
|
823 EMatchKeyCaseInsens |
|
824 }, |
|
825 { |
|
826 EStateNormal, |
|
827 EPassSpecialKeyThru, |
|
828 ELatin1LcIacute |
|
829 } |
|
830 }, |
|
831 { |
|
832 { |
|
833 EModifierFunc|EModifierKeyUp, |
|
834 0 |
|
835 }, |
|
836 { |
|
837 'o', |
|
838 EMatchKeyCaseInsens |
|
839 }, |
|
840 { |
|
841 EStateNormal, |
|
842 EPassSpecialKeyThru, |
|
843 ELatin1LcOacute |
|
844 } |
|
845 }, |
|
846 { |
|
847 { |
|
848 EModifierFunc|EModifierKeyUp, |
|
849 0 |
|
850 }, |
|
851 { |
|
852 'u', |
|
853 EMatchKeyCaseInsens |
|
854 }, |
|
855 { |
|
856 EStateNormal, |
|
857 EPassSpecialKeyThru, |
|
858 ELatin1LcUacute |
|
859 } |
|
860 }, |
|
861 { |
|
862 { |
|
863 EModifierFunc|EModifierKeyUp, |
|
864 0 |
|
865 }, |
|
866 { |
|
867 'y', |
|
868 EMatchKeyCaseInsens |
|
869 }, |
|
870 { |
|
871 EStateNormal, |
|
872 EPassSpecialKeyThru, |
|
873 ELatin1LcYacute |
|
874 } |
|
875 }, |
|
876 { |
|
877 { |
|
878 EModifierFunc|EModifierKeyUp, |
|
879 0 |
|
880 }, |
|
881 { |
|
882 ' ', |
|
883 EMatchKey |
|
884 }, |
|
885 { |
|
886 EStateNormal, |
|
887 EPassSpecialKeyThru, |
|
888 ELatin1LcSpaceAcute |
|
889 } |
|
890 }, |
|
891 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
892 }; |
|
893 |
|
894 LOCAL_D const SFuncTableEntry table5[]= |
|
895 { |
|
896 { |
|
897 { |
|
898 EModifierFunc|EModifierKeyUp, |
|
899 0 |
|
900 }, |
|
901 { |
|
902 'a', |
|
903 EMatchKeyCaseInsens |
|
904 }, |
|
905 { |
|
906 EStateNormal, |
|
907 EPassSpecialKeyThru, |
|
908 ELatin1LcAtilde |
|
909 } |
|
910 }, |
|
911 { |
|
912 { |
|
913 EModifierFunc|EModifierKeyUp, |
|
914 0 |
|
915 }, |
|
916 { |
|
917 'n', |
|
918 EMatchKeyCaseInsens |
|
919 }, |
|
920 { |
|
921 EStateNormal, |
|
922 EPassSpecialKeyThru, |
|
923 ELatin1LcNtilde |
|
924 } |
|
925 }, |
|
926 { |
|
927 { |
|
928 EModifierFunc|EModifierKeyUp, |
|
929 0 |
|
930 }, |
|
931 { |
|
932 'o', |
|
933 EMatchKeyCaseInsens |
|
934 }, |
|
935 { |
|
936 EStateNormal, |
|
937 EPassSpecialKeyThru, |
|
938 ELatin1LcOtilde |
|
939 } |
|
940 }, |
|
941 { |
|
942 { |
|
943 EModifierFunc|EModifierKeyUp, |
|
944 0 |
|
945 }, |
|
946 { |
|
947 ' ', |
|
948 EMatchKey |
|
949 }, |
|
950 { |
|
951 EStateNormal, |
|
952 EPassSpecialKeyThru, |
|
953 ELatin1LcSpaceTilde |
|
954 } |
|
955 }, |
|
956 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
957 }; |
|
958 |
|
959 LOCAL_D const SFuncTableEntry table6[]= |
|
960 { |
|
961 { |
|
962 { |
|
963 EModifierFunc|EModifierKeyUp, |
|
964 0 |
|
965 }, |
|
966 { |
|
967 'a', |
|
968 EMatchKeyCaseInsens |
|
969 }, |
|
970 { |
|
971 EStateNormal, |
|
972 EPassSpecialKeyThru, |
|
973 ELatin1LcAcirc |
|
974 } |
|
975 }, |
|
976 { |
|
977 { |
|
978 EModifierFunc|EModifierKeyUp, |
|
979 0 |
|
980 }, |
|
981 { |
|
982 'e', |
|
983 EMatchKeyCaseInsens |
|
984 }, |
|
985 { |
|
986 EStateNormal, |
|
987 EPassSpecialKeyThru, |
|
988 ELatin1LcEcirc |
|
989 } |
|
990 }, |
|
991 { |
|
992 { |
|
993 EModifierFunc|EModifierKeyUp, |
|
994 0 |
|
995 }, |
|
996 { |
|
997 'i', |
|
998 EMatchKeyCaseInsens |
|
999 }, |
|
1000 { |
|
1001 EStateNormal, |
|
1002 EPassSpecialKeyThru, |
|
1003 ELatin1LcIcirc |
|
1004 } |
|
1005 }, |
|
1006 { |
|
1007 { |
|
1008 EModifierFunc|EModifierKeyUp, |
|
1009 0 |
|
1010 }, |
|
1011 { |
|
1012 'o', |
|
1013 EMatchKeyCaseInsens |
|
1014 }, |
|
1015 { |
|
1016 EStateNormal, |
|
1017 EPassSpecialKeyThru, |
|
1018 ELatin1LcOcirc |
|
1019 } |
|
1020 }, |
|
1021 { |
|
1022 { |
|
1023 EModifierFunc|EModifierKeyUp, |
|
1024 0 |
|
1025 }, |
|
1026 { |
|
1027 'u', |
|
1028 EMatchKeyCaseInsens |
|
1029 }, |
|
1030 { |
|
1031 EStateNormal, |
|
1032 EPassSpecialKeyThru, |
|
1033 ELatin1LcUcirc |
|
1034 } |
|
1035 }, |
|
1036 { |
|
1037 { |
|
1038 EModifierFunc|EModifierKeyUp, |
|
1039 0 |
|
1040 }, |
|
1041 { |
|
1042 ' ', |
|
1043 EMatchKey |
|
1044 }, |
|
1045 { |
|
1046 EStateNormal, |
|
1047 EPassSpecialKeyThru, |
|
1048 ELatin1LcSpaceCirc |
|
1049 } |
|
1050 }, |
|
1051 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1052 }; |
|
1053 |
|
1054 LOCAL_D const SFuncTableEntry table7[]= |
|
1055 { |
|
1056 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1057 }; |
|
1058 |
|
1059 LOCAL_D const SFuncTableEntry table8[]= |
|
1060 { |
|
1061 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1062 }; |
|
1063 |
|
1064 LOCAL_D const SFuncTableEntry table9[]= |
|
1065 { |
|
1066 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1067 }; |
|
1068 |
|
1069 LOCAL_D const SFuncTableEntry table10[]= |
|
1070 { |
|
1071 { // check for ctrl-number presses |
|
1072 { |
|
1073 EModifierCtrl|EModifierFunc|EModifierKeyUp, |
|
1074 EModifierCtrl |
|
1075 }, |
|
1076 { |
|
1077 EKeyNull, |
|
1078 EAnyDecimalDigit |
|
1079 }, |
|
1080 { |
|
1081 EStateDerivedFromDigitEntered, |
|
1082 EAddOnCtrlDigit, |
|
1083 0 |
|
1084 } |
|
1085 }, |
|
1086 { // filter out up key strokes |
|
1087 { |
|
1088 EModifierKeyUp, |
|
1089 EModifierKeyUp |
|
1090 }, |
|
1091 { |
|
1092 EKeyNull, |
|
1093 EAnyKey |
|
1094 }, |
|
1095 { |
|
1096 EStateUnchanged, |
|
1097 EDoNothing, |
|
1098 0 |
|
1099 } |
|
1100 }, |
|
1101 { // pass thru any non-processed keys |
|
1102 { |
|
1103 0, |
|
1104 0 |
|
1105 }, |
|
1106 { |
|
1107 EKeyNull, |
|
1108 EAnyKey |
|
1109 }, |
|
1110 { |
|
1111 EStateUnchanged, |
|
1112 EPassKeyThru, |
|
1113 0 |
|
1114 } |
|
1115 } |
|
1116 }; |
|
1117 |
|
1118 //LOCAL_D const SFuncTableEntry table11[]= |
|
1119 // { |
|
1120 // TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1121 // }; |
|
1122 |
|
1123 LOCAL_D const SFuncTableEntry table12[]= |
|
1124 { |
|
1125 { |
|
1126 { |
|
1127 EModifierKeyUp, |
|
1128 EModifierKeyUp |
|
1129 }, |
|
1130 { |
|
1131 EKeyLeftCtrl, |
|
1132 EMatchLeftOrRight |
|
1133 }, |
|
1134 { |
|
1135 EStateNormal, |
|
1136 EPassCtrlDigitsThru, |
|
1137 0 |
|
1138 } |
|
1139 }, |
|
1140 TABLE_ENTRY_ANOTHER_CTRL_DIGIT |
|
1141 }; |
|
1142 |
|
1143 LOCAL_D const SFuncTable genFuncTables[]= |
|
1144 { |
|
1145 { |
|
1146 ARRAY_LENGTH(table0), |
|
1147 &table0[0] |
|
1148 }, |
|
1149 { |
|
1150 ARRAY_LENGTH(table1), |
|
1151 &table1[0] |
|
1152 }, |
|
1153 { |
|
1154 ARRAY_LENGTH(table2), |
|
1155 &table2[0] |
|
1156 }, |
|
1157 { |
|
1158 ARRAY_LENGTH(table3), |
|
1159 &table3[0] |
|
1160 }, |
|
1161 { |
|
1162 ARRAY_LENGTH(table4), |
|
1163 &table4[0] |
|
1164 }, |
|
1165 { |
|
1166 ARRAY_LENGTH(table5), |
|
1167 &table5[0] |
|
1168 }, |
|
1169 { |
|
1170 ARRAY_LENGTH(table6), |
|
1171 &table6[0] |
|
1172 }, |
|
1173 { |
|
1174 ARRAY_LENGTH(table7), |
|
1175 &table7[0] |
|
1176 }, |
|
1177 { |
|
1178 ARRAY_LENGTH(table8), |
|
1179 &table8[0] |
|
1180 }, |
|
1181 { |
|
1182 ARRAY_LENGTH(table9), |
|
1183 &table9[0] |
|
1184 }, |
|
1185 { |
|
1186 ARRAY_LENGTH(table10), |
|
1187 &table10[0] |
|
1188 }, |
|
1189 { |
|
1190 0, |
|
1191 NULL |
|
1192 }, |
|
1193 { |
|
1194 ARRAY_LENGTH(table12), |
|
1195 &table12[0] |
|
1196 } |
|
1197 }; |
|
1198 |
|
1199 LOCAL_D const SFuncTables FuncTables= |
|
1200 { |
|
1201 { |
|
1202 ARRAY_LENGTH(defaultTable), |
|
1203 &defaultTable[0] |
|
1204 }, |
|
1205 { |
|
1206 ARRAY_LENGTH(modifierTable), |
|
1207 &modifierTable[0] |
|
1208 }, |
|
1209 ARRAY_LENGTH(genFuncTables), |
|
1210 &genFuncTables[0] |
|
1211 }; |
|
1212 |
|
1213 LOCAL_D const SScanCodeBlock scanCodeBlock_unmodifiable[]= |
|
1214 { |
|
1215 {EStdKeyLeftShift, EStdKeyScrollLock} |
|
1216 }; |
|
1217 |
|
1218 LOCAL_D const TUint16 convKeyCodes_unmodifiable[]= |
|
1219 { |
|
1220 EKeyLeftShift, |
|
1221 EKeyRightShift, |
|
1222 EKeyLeftAlt, |
|
1223 EKeyRightAlt, |
|
1224 EKeyLeftCtrl, |
|
1225 EKeyRightCtrl, |
|
1226 EKeyLeftFunc, |
|
1227 EKeyRightFunc, |
|
1228 EKeyCapsLock, |
|
1229 EKeyNumLock, |
|
1230 EKeyScrollLock |
|
1231 }; |
|
1232 |
|
1233 // base: this table traps all of the keyboard's scanCodes except those in convKeyCodes_unmodifiable |
|
1234 LOCAL_D const SScanCodeBlock scanCodeBlock_base[]= |
|
1235 { |
|
1236 {EStdKeyNull, EStdKeyDownArrow}, |
|
1237 {'0', '9'}, |
|
1238 {'A', 'Z'}, |
|
1239 {EStdKeyF1, EStdKeyDial}, |
|
1240 {EStdKeyIncVolume, EStdKeyDecVolume}, |
|
1241 {EStdKeyDevice0,EStdKeyDeviceF}, |
|
1242 {EStdKeyApplication0, EStdKeyApplicationF}, |
|
1243 {EStdKeyYes, EStdKeyDecBrightness}, |
|
1244 {EStdKeyDevice10,EStdKeyDevice1F}, |
|
1245 {EStdKeyApplication10, EStdKeyApplication1F}, |
|
1246 {EStdKeyDevice20,EStdKeyDevice27}, |
|
1247 {EStdKeyApplication20, EStdKeyApplication27} |
|
1248 }; |
|
1249 |
|
1250 // |
|
1251 // This table is internatioalizable |
|
1252 // |
|
1253 LOCAL_D const TUint16 convKeyCodes_base[]= |
|
1254 { |
|
1255 EKeyNull, |
|
1256 EKeyBackspace, |
|
1257 EKeyTab, |
|
1258 EKeyEnter, |
|
1259 EKeyEscape, |
|
1260 ' ', |
|
1261 EKeyPrintScreen, |
|
1262 EKeyPause, |
|
1263 EKeyHome, |
|
1264 EKeyEnd, |
|
1265 EKeyPageUp, |
|
1266 EKeyPageDown, |
|
1267 EKeyInsert, |
|
1268 EKeyDelete, |
|
1269 EKeyLeftArrow, |
|
1270 EKeyRightArrow, |
|
1271 EKeyUpArrow, |
|
1272 EKeyDownArrow, |
|
1273 '0', |
|
1274 '1', |
|
1275 '2', |
|
1276 '3', |
|
1277 '4', |
|
1278 '5', |
|
1279 '6', |
|
1280 '7', |
|
1281 '8', |
|
1282 '9', |
|
1283 'a', |
|
1284 'b', |
|
1285 'c', |
|
1286 'd', |
|
1287 'e', |
|
1288 'f', |
|
1289 'g', |
|
1290 'h', |
|
1291 'i', |
|
1292 'j', |
|
1293 'k', |
|
1294 'l', |
|
1295 'm', |
|
1296 'n', |
|
1297 'o', |
|
1298 'p', |
|
1299 'q', |
|
1300 'r', |
|
1301 's', |
|
1302 't', |
|
1303 'u', |
|
1304 'v', |
|
1305 'w', |
|
1306 'x', |
|
1307 'y', |
|
1308 'z', |
|
1309 EKeyF1, |
|
1310 EKeyF2, |
|
1311 EKeyF3, |
|
1312 EKeyF4, |
|
1313 EKeyF5, // Media change emulation |
|
1314 EKeyF6, |
|
1315 EKeyF7, |
|
1316 EKeyF8, // Case close |
|
1317 EKeyF9, // KeyOff |
|
1318 EKeyF10, // SwitchOff |
|
1319 EKeyF11, // Case open |
|
1320 EKeyF12, |
|
1321 EKeyF13, |
|
1322 EKeyF14, |
|
1323 EKeyF15, |
|
1324 EKeyF16, |
|
1325 EKeyF17, |
|
1326 EKeyF18, |
|
1327 EKeyF19, |
|
1328 EKeyF20, |
|
1329 EKeyF21, |
|
1330 EKeyF22, |
|
1331 EKeyF23, |
|
1332 EKeyF24, |
|
1333 '`', |
|
1334 ',', |
|
1335 '.', |
|
1336 '/', |
|
1337 '\\', |
|
1338 ';', |
|
1339 '\'', |
|
1340 '#', |
|
1341 '[', |
|
1342 ']', |
|
1343 '-', |
|
1344 '=', |
|
1345 '/', |
|
1346 '*', |
|
1347 '-', |
|
1348 '+', |
|
1349 EKeyEnter, |
|
1350 EKeyEnd, |
|
1351 EKeyDownArrow, |
|
1352 EKeyPageDown, |
|
1353 EKeyLeftArrow, |
|
1354 EKeyNull, // numeric keypad '5' |
|
1355 EKeyRightArrow, |
|
1356 EKeyHome, |
|
1357 EKeyUpArrow, |
|
1358 EKeyPageUp, |
|
1359 EKeyInsert, |
|
1360 EKeyDelete, |
|
1361 EKeyMenu, |
|
1362 EKeyBacklightOn, |
|
1363 EKeyBacklightOff, |
|
1364 EKeyBacklightToggle, |
|
1365 EKeyIncContrast, |
|
1366 EKeyDecContrast, |
|
1367 EKeySliderDown, |
|
1368 EKeySliderUp, |
|
1369 EKeyDictaphonePlay, |
|
1370 EKeyDictaphoneStop, |
|
1371 EKeyDictaphoneRecord, |
|
1372 EKeyHelp, |
|
1373 EKeyOff, |
|
1374 EKeyDial, |
|
1375 EKeyIncVolume, |
|
1376 EKeyDecVolume, |
|
1377 EKeyDevice0, |
|
1378 EKeyDevice1, |
|
1379 EKeyDevice2, |
|
1380 EKeyDevice3, |
|
1381 EKeyDevice4, |
|
1382 EKeyDevice5, |
|
1383 EKeyDevice6, |
|
1384 EKeyDevice7, |
|
1385 EKeyDevice8, |
|
1386 EKeyDevice9, |
|
1387 EKeyDeviceA, |
|
1388 EKeyDeviceB, |
|
1389 EKeyDeviceC, |
|
1390 EKeyDeviceD, |
|
1391 EKeyDeviceE, |
|
1392 EKeyDeviceF, |
|
1393 EKeyApplication0, |
|
1394 EKeyApplication1, |
|
1395 EKeyApplication2, |
|
1396 EKeyApplication3, |
|
1397 EKeyApplication4, |
|
1398 EKeyApplication5, |
|
1399 EKeyApplication6, |
|
1400 EKeyApplication7, |
|
1401 EKeyApplication8, |
|
1402 EKeyApplication9, |
|
1403 EKeyApplicationA, |
|
1404 EKeyApplicationB, |
|
1405 EKeyApplicationC, |
|
1406 EKeyApplicationD, |
|
1407 EKeyApplicationE, |
|
1408 EKeyApplicationF, |
|
1409 EKeyYes, |
|
1410 EKeyNo, |
|
1411 EKeyIncBrightness, |
|
1412 EKeyDecBrightness, |
|
1413 EKeyDevice10, |
|
1414 EKeyDevice11, |
|
1415 EKeyDevice12, |
|
1416 EKeyDevice13, |
|
1417 EKeyDevice14, |
|
1418 EKeyDevice15, |
|
1419 EKeyDevice16, |
|
1420 EKeyDevice17, |
|
1421 EKeyDevice18, |
|
1422 EKeyDevice19, |
|
1423 EKeyDevice1A, |
|
1424 EKeyDevice1B, |
|
1425 EKeyDevice1C, |
|
1426 EKeyDevice1D, |
|
1427 EKeyDevice1E, |
|
1428 EKeyDevice1F, |
|
1429 EKeyApplication10, |
|
1430 EKeyApplication11, |
|
1431 EKeyApplication12, |
|
1432 EKeyApplication13, |
|
1433 EKeyApplication14, |
|
1434 EKeyApplication15, |
|
1435 EKeyApplication16, |
|
1436 EKeyApplication17, |
|
1437 EKeyApplication18, |
|
1438 EKeyApplication19, |
|
1439 EKeyApplication1A, |
|
1440 EKeyApplication1B, |
|
1441 EKeyApplication1C, |
|
1442 EKeyApplication1D, |
|
1443 EKeyApplication1E, |
|
1444 EKeyApplication1F, |
|
1445 EKeyDevice20, |
|
1446 EKeyDevice21, |
|
1447 EKeyDevice22, |
|
1448 EKeyDevice23, |
|
1449 EKeyDevice24, |
|
1450 EKeyDevice25, |
|
1451 EKeyDevice26, |
|
1452 EKeyDevice27, |
|
1453 EKeyApplication20, |
|
1454 EKeyApplication21, |
|
1455 EKeyApplication22, |
|
1456 EKeyApplication23, |
|
1457 EKeyApplication24, |
|
1458 EKeyApplication25, |
|
1459 EKeyApplication26, |
|
1460 EKeyApplication27 |
|
1461 }; |
|
1462 |
|
1463 // caps-lock: this table traps those scanCodes which are affected by caps-lock |
|
1464 LOCAL_D const SScanCodeBlock scanCodeBlock_capsLock[]= |
|
1465 { |
|
1466 {'A', 'Z'} |
|
1467 }; |
|
1468 |
|
1469 LOCAL_D const TUint16 convKeyCodes_capsLock[]= |
|
1470 { |
|
1471 'A', |
|
1472 'B', |
|
1473 'C', |
|
1474 'D', |
|
1475 'E', |
|
1476 'F', |
|
1477 'G', |
|
1478 'H', |
|
1479 'I', |
|
1480 'J', |
|
1481 'K', |
|
1482 'L', |
|
1483 'M', |
|
1484 'N', |
|
1485 'O', |
|
1486 'P', |
|
1487 'Q', |
|
1488 'R', |
|
1489 'S', |
|
1490 'T', |
|
1491 'U', |
|
1492 'V', |
|
1493 'W', |
|
1494 'X', |
|
1495 'Y', |
|
1496 'Z' |
|
1497 }; |
|
1498 |
|
1499 // shift: this table traps those scanCodes which are affected |
|
1500 // by shift EXCEPT for those scanCodes affected by caps-lock |
|
1501 LOCAL_D const SScanCodeBlock scanCodeBlock_shift[]= |
|
1502 { |
|
1503 {'0', '9'}, |
|
1504 {EStdKeyXXX, EStdKeyEquals}, |
|
1505 }; |
|
1506 |
|
1507 // |
|
1508 // This table is internatioalizable |
|
1509 // |
|
1510 LOCAL_D const TUint16 convKeyCodes_shift[]= |
|
1511 { |
|
1512 ')', |
|
1513 '!', |
|
1514 '"', |
|
1515 ELatin1Pound, |
|
1516 '$', |
|
1517 '%', |
|
1518 '^', |
|
1519 '&', |
|
1520 '*', |
|
1521 '(', |
|
1522 ELatin1LogicNot, |
|
1523 '<', |
|
1524 '>', |
|
1525 '?', |
|
1526 '|', |
|
1527 ':', |
|
1528 '@', |
|
1529 '~', |
|
1530 '{', |
|
1531 '}', |
|
1532 '_', |
|
1533 '+' |
|
1534 }; |
|
1535 |
|
1536 // numlock: this table traps those scanCodes which are affected by numlock |
|
1537 LOCAL_D const SScanCodeBlock scanCodeBlock_numLock[]= |
|
1538 { |
|
1539 {EStdKeyNkpForwardSlash, EStdKeyNkpFullStop} |
|
1540 }; |
|
1541 |
|
1542 LOCAL_D const TUint16 convKeyCodes_numLock[]= |
|
1543 { |
|
1544 '/', |
|
1545 '*', |
|
1546 '-', |
|
1547 '+', |
|
1548 EKeyEnter, |
|
1549 '1', |
|
1550 '2', |
|
1551 '3', |
|
1552 '4', |
|
1553 '5', |
|
1554 '6', |
|
1555 '7', |
|
1556 '8', |
|
1557 '9', |
|
1558 '0', |
|
1559 '.' |
|
1560 }; |
|
1561 |
|
1562 // ctrl: this table traps those scanCodes which are affected by ctrl |
|
1563 LOCAL_D const SScanCodeBlock scanCodeBlock_ctrl[]= |
|
1564 { |
|
1565 // The space key gets handled else where, otherwise it gets |
|
1566 // thrown away as a NULL key |
|
1567 // {EStdKeySpace, EStdKeySpace}, |
|
1568 |
|
1569 {'A', 'Z'} |
|
1570 }; |
|
1571 |
|
1572 LOCAL_D const TUint16 convKeyCodes_ctrl[]= |
|
1573 { |
|
1574 // 0, |
|
1575 1, |
|
1576 2, |
|
1577 3, |
|
1578 4, |
|
1579 5, |
|
1580 6, |
|
1581 7, |
|
1582 8, |
|
1583 9, |
|
1584 10, |
|
1585 11, |
|
1586 12, |
|
1587 13, |
|
1588 14, |
|
1589 15, |
|
1590 16, |
|
1591 17, |
|
1592 18, |
|
1593 19, |
|
1594 20, |
|
1595 21, |
|
1596 22, |
|
1597 23, |
|
1598 24, |
|
1599 25, |
|
1600 26 |
|
1601 }; |
|
1602 |
|
1603 // Rotate by 90: this table traps those scancodes which are affected by the RotateBy90 modifier |
|
1604 LOCAL_D const SScanCodeBlock scanCodeBlock_rotate[]= |
|
1605 { |
|
1606 {'Q', 'Q'}, |
|
1607 {'W', 'W'}, |
|
1608 {'E', 'E'}, |
|
1609 {'A', 'A'}, |
|
1610 {'S', 'S'}, |
|
1611 {'D', 'D'}, |
|
1612 {'Z', 'Z'}, |
|
1613 {'X', 'X'}, |
|
1614 {'C', 'C'}, |
|
1615 }; |
|
1616 |
|
1617 //rotate this 3x3 block of keys 90 degrees clockwise |
|
1618 LOCAL_D const TUint16 convKeyCodes_rot90[]= |
|
1619 { |
|
1620 'z', |
|
1621 'a', |
|
1622 'q', |
|
1623 'x', |
|
1624 's', |
|
1625 'w', |
|
1626 'c', |
|
1627 'd', |
|
1628 'e', |
|
1629 }; |
|
1630 |
|
1631 //rotate this 3x3 block of keys 180 degrees clockwise |
|
1632 LOCAL_D const TUint16 convKeyCodes_rot180[]= |
|
1633 { |
|
1634 'c', |
|
1635 'x', |
|
1636 'z', |
|
1637 'd', |
|
1638 's', |
|
1639 'a', |
|
1640 'e', |
|
1641 'w', |
|
1642 'q', |
|
1643 }; |
|
1644 |
|
1645 //rotate this 3x3 block of keys 90 degrees clockwise |
|
1646 LOCAL_D const TUint16 convKeyCodes_rot270[]= |
|
1647 { |
|
1648 'e', |
|
1649 'd', |
|
1650 'c', |
|
1651 'w', |
|
1652 's', |
|
1653 'x', |
|
1654 'q', |
|
1655 'a', |
|
1656 'z', |
|
1657 }; |
|
1658 |
|
1659 LOCAL_D const SConvSubTable |
|
1660 convSubTable_unmodifiable= |
|
1661 { |
|
1662 &convKeyCodes_unmodifiable[0], |
|
1663 { |
|
1664 ARRAY_LENGTH(scanCodeBlock_unmodifiable), |
|
1665 &scanCodeBlock_unmodifiable[0] |
|
1666 } |
|
1667 }, |
|
1668 convSubTable_base= |
|
1669 { |
|
1670 &convKeyCodes_base[0], |
|
1671 { |
|
1672 ARRAY_LENGTH(scanCodeBlock_base), |
|
1673 &scanCodeBlock_base[0] |
|
1674 } |
|
1675 }, |
|
1676 convSubTable_capsLock= |
|
1677 { |
|
1678 &convKeyCodes_capsLock[0], |
|
1679 { |
|
1680 ARRAY_LENGTH(scanCodeBlock_capsLock), |
|
1681 &scanCodeBlock_capsLock[0] |
|
1682 } |
|
1683 }, |
|
1684 convSubTable_shift= |
|
1685 { |
|
1686 &convKeyCodes_shift[0], |
|
1687 { |
|
1688 ARRAY_LENGTH(scanCodeBlock_shift), |
|
1689 &scanCodeBlock_shift[0] |
|
1690 } |
|
1691 }, |
|
1692 convSubTable_numLock= |
|
1693 { |
|
1694 &convKeyCodes_numLock[0], |
|
1695 { |
|
1696 ARRAY_LENGTH(scanCodeBlock_numLock), |
|
1697 &scanCodeBlock_numLock[0] |
|
1698 } |
|
1699 }, |
|
1700 convSubTable_ctrl= |
|
1701 { |
|
1702 &convKeyCodes_ctrl[0], |
|
1703 { |
|
1704 ARRAY_LENGTH(scanCodeBlock_ctrl), |
|
1705 &scanCodeBlock_ctrl[0] |
|
1706 } |
|
1707 }, |
|
1708 convSubTable_rot90= |
|
1709 { |
|
1710 &convKeyCodes_rot90[0], |
|
1711 { |
|
1712 ARRAY_LENGTH(scanCodeBlock_rotate), |
|
1713 &scanCodeBlock_rotate[0] |
|
1714 } |
|
1715 }, |
|
1716 convSubTable_rot180= |
|
1717 { |
|
1718 &convKeyCodes_rot180[0], |
|
1719 { |
|
1720 ARRAY_LENGTH(scanCodeBlock_rotate), |
|
1721 &scanCodeBlock_rotate[0] |
|
1722 } |
|
1723 }, |
|
1724 convSubTable_rot270= |
|
1725 { |
|
1726 &convKeyCodes_rot270[0], |
|
1727 { |
|
1728 ARRAY_LENGTH(scanCodeBlock_rotate), |
|
1729 &scanCodeBlock_rotate[0] |
|
1730 } |
|
1731 }; |
|
1732 |
|
1733 // Some modifiers, e.g. shift, may required more than one table (other than "base") |
|
1734 // to be searched; therefore arrays of tables are required |
|
1735 LOCAL_D const SConvSubTable |
|
1736 * const convSubTableArray_unmodifiable[]={&convSubTable_unmodifiable}, |
|
1737 * const convSubTableArray_base[]={&convSubTable_base}, |
|
1738 * const convSubTableArray_capsLock[]={&convSubTable_capsLock}, |
|
1739 * const convSubTableArray_shift[]={&convSubTable_capsLock, &convSubTable_shift}, |
|
1740 * const convSubTableArray_capsLockShift[]={&convSubTable_shift}, |
|
1741 * const convSubTableArray_numLock[]={&convSubTable_numLock}, |
|
1742 * const convSubTableArray_ctrl[]={&convSubTable_ctrl}, |
|
1743 * const convSubTableArray_rot90[]={&convSubTable_rot90}, |
|
1744 * const convSubTableArray_rot180[]={&convSubTable_rot180}, |
|
1745 * const convSubTableArray_rot270[]={&convSubTable_rot270}; |
|
1746 |
|
1747 // The order of these nodes is VITAL, as the scanCode/modifiers are |
|
1748 // searched for a match in this order |
|
1749 LOCAL_D const SConvTableNode convTableNodes[]= |
|
1750 { |
|
1751 { |
|
1752 { |
|
1753 0, /* iMask */ |
|
1754 0 /* iValue */ |
|
1755 }, /* maskedModifiers */ |
|
1756 ARRAY_LENGTH(convSubTableArray_unmodifiable), /* numSubTables */ |
|
1757 &convSubTableArray_unmodifiable[0] |
|
1758 }, /* pnodes[i] */ |
|
1759 { |
|
1760 { |
|
1761 EModifierCtrl, |
|
1762 EModifierCtrl |
|
1763 }, |
|
1764 ARRAY_LENGTH(convSubTableArray_ctrl), |
|
1765 &convSubTableArray_ctrl[0] |
|
1766 }, |
|
1767 { |
|
1768 { |
|
1769 EModifierNumLock, |
|
1770 EModifierNumLock |
|
1771 }, |
|
1772 ARRAY_LENGTH(convSubTableArray_numLock), |
|
1773 &convSubTableArray_numLock[0] |
|
1774 }, |
|
1775 { |
|
1776 { |
|
1777 EModifierCapsLock|EModifierShift, |
|
1778 EModifierCapsLock |
|
1779 }, |
|
1780 ARRAY_LENGTH(convSubTableArray_capsLock), |
|
1781 &convSubTableArray_capsLock[0] |
|
1782 }, |
|
1783 { |
|
1784 { |
|
1785 EModifierShift|EModifierCapsLock, |
|
1786 EModifierShift |
|
1787 }, |
|
1788 ARRAY_LENGTH(convSubTableArray_shift), |
|
1789 &convSubTableArray_shift[0] |
|
1790 }, |
|
1791 { |
|
1792 { |
|
1793 EModifierCapsLock|EModifierShift, |
|
1794 EModifierCapsLock|EModifierShift |
|
1795 }, |
|
1796 ARRAY_LENGTH(convSubTableArray_capsLockShift), |
|
1797 &convSubTableArray_capsLockShift[0] |
|
1798 }, |
|
1799 { |
|
1800 { |
|
1801 EModifierRotateBy90, |
|
1802 EModifierRotateBy90 |
|
1803 }, |
|
1804 ARRAY_LENGTH(convSubTableArray_rot90), |
|
1805 &convSubTableArray_rot90[0] |
|
1806 }, |
|
1807 { |
|
1808 { |
|
1809 EModifierRotateBy180, |
|
1810 EModifierRotateBy180 |
|
1811 }, |
|
1812 ARRAY_LENGTH(convSubTableArray_rot180), |
|
1813 &convSubTableArray_rot180[0] |
|
1814 }, |
|
1815 { |
|
1816 { |
|
1817 EModifierRotateBy270, |
|
1818 EModifierRotateBy270 |
|
1819 }, |
|
1820 ARRAY_LENGTH(convSubTableArray_rot270), |
|
1821 &convSubTableArray_rot270[0] |
|
1822 }, |
|
1823 { |
|
1824 { |
|
1825 0, |
|
1826 0 |
|
1827 }, |
|
1828 ARRAY_LENGTH(convSubTableArray_base), |
|
1829 &convSubTableArray_base[0] |
|
1830 } |
|
1831 }; |
|
1832 |
|
1833 // The top-level exported data structure of all the conversion tables |
|
1834 LOCAL_D const SConvTable ConvTable= |
|
1835 { |
|
1836 ARRAY_LENGTH(convTableNodes), |
|
1837 &convTableNodes[0] |
|
1838 }; |
|
1839 |
|
1840 // The list of scan-codes on the numeric keypad |
|
1841 LOCAL_D const SScanCodeBlock keypadScanCodeBlockArray[]= |
|
1842 { |
|
1843 {EStdKeyNumLock, EStdKeyNumLock}, |
|
1844 {EStdKeyNkpForwardSlash, EStdKeyNkpFullStop} |
|
1845 }; |
|
1846 |
|
1847 LOCAL_D const SScanCodeBlockList ConvTableKeypadScanCodes= |
|
1848 { |
|
1849 ARRAY_LENGTH(keypadScanCodeBlockArray), |
|
1850 &keypadScanCodeBlockArray[0] |
|
1851 }; |
|
1852 |
|
1853 // The list of non-autorepeating key-codes |
|
1854 LOCAL_D const TUint16 nonAutorepKeyCodeArray[]= |
|
1855 { |
|
1856 EKeyEscape, |
|
1857 EKeyPrintScreen, |
|
1858 EKeyPause, |
|
1859 EKeyInsert, |
|
1860 EKeyLeftShift, |
|
1861 EKeyRightShift, |
|
1862 EKeyLeftAlt, |
|
1863 EKeyRightAlt, |
|
1864 EKeyLeftCtrl, |
|
1865 EKeyRightCtrl, |
|
1866 EKeyLeftFunc, |
|
1867 EKeyRightFunc, |
|
1868 EKeyCapsLock, |
|
1869 EKeyNumLock, |
|
1870 EKeyScrollLock, |
|
1871 EKeyMenu, |
|
1872 EKeyDictaphonePlay, |
|
1873 EKeyDictaphoneStop, |
|
1874 EKeyDictaphoneRecord |
|
1875 }; |
|
1876 |
|
1877 LOCAL_D const SKeyCodeList ConvTableNonAutorepKeyCodes= |
|
1878 { |
|
1879 ARRAY_LENGTH(nonAutorepKeyCodeArray), |
|
1880 &nonAutorepKeyCodeArray[0] |
|
1881 }; |
|
1882 |
|
1883 EXPORT_C void KeyDataSettings(TRadix &aRadix,TCtrlDigitsTermination &aCtrlDigitsTermination,TInt &aDefaultCtrlDigitsMaxCount, |
|
1884 TInt &aMaximumCtrlDigitsMaxCount) |
|
1885 { |
|
1886 aRadix=EDecimal; |
|
1887 aCtrlDigitsTermination=ETerminationByCtrlUp; |
|
1888 aDefaultCtrlDigitsMaxCount=3; |
|
1889 aMaximumCtrlDigitsMaxCount=10; |
|
1890 } |
|
1891 |
|
1892 EXPORT_C void KeyDataFuncTable(SFuncTables &aFuncTables) |
|
1893 { |
|
1894 aFuncTables=FuncTables; |
|
1895 } |
|
1896 |
|
1897 EXPORT_C void KeyDataConvTable(SConvTable &aConvTable, TUint &aConvTableFirstScanCode,TUint &aConvTableLastScanCode, |
|
1898 SScanCodeBlockList &aKeypadScanCode,SKeyCodeList &aNonAutorepKeyCodes) |
|
1899 { |
|
1900 aConvTable=ConvTable; |
|
1901 aConvTableFirstScanCode=scanCodeBlock_base[0].firstScanCode; |
|
1902 aConvTableLastScanCode=scanCodeBlock_base[ARRAY_LENGTH(scanCodeBlock_base)-1].lastScanCode; |
|
1903 aKeypadScanCode=ConvTableKeypadScanCodes; |
|
1904 aNonAutorepKeyCodes=ConvTableNonAutorepKeyCodes; |
|
1905 } |