annotate src/ui3/mfw/mfw_kbd.c @ 420:e8ddbb0837ed

src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Jan 2018 03:09:00 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
420
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_kbd.c $|
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | $Author:: Es $ CONDAT GmbH $Revision:: 18 $|
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 | CREATED: 21.09.98 $Modtime:: 23.03.00 8:24 $|
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | STATE : code |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 MODULE : MFW_KBD
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 PURPOSE : keyboard handling functions
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 EXPORT :
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 TO DO : adjust PEI/driver interface
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 HISTORY :
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 Sep 14, 2007 REF: OMAPS00145862 Adrian Salido
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 Description: FT - MMI: Wrong trace class
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 Solution: changed some event traces to function traces because the information content of
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 this is low for non-MMI people and against TI coding convention.
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 Oct 13, 2006 REF: OMAPS00097121 - x0039928
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 Description: Keyboard pressed in a loop. KBP_R after suspend-resume
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 Solution : If the Auto press timer expires mmi checks the bsp kpd status and accordingly
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 sets auto key in the key map.
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 Sep 18, 2006 REF: OMAPS00094426 - x0039928
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 Description: Locosto - KPD Release event would NOT be generated if a key is pressed
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 several times in a short period of time
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 Solution : If the long press timer expires mmi checks the bsp kpd status and accordingly
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 sets long press bit in the key map.
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 xrashmic 22 Aug, 2004 MMI-SPR-32798
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 Adding the support for screen capture using a dynamically assigned key.
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 Apr 03, 2005 REF: CRR 29988 - xpradipg
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 Description: Optimisation 2: Reduce the keyboard buffer and the dtmf buffer
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 size
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 Solution : The keyboard buffer is reduced to 20 from 50
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #define ENTITY_MFW
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #include "typedefs.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #include "vsi.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #include "pei.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #include "custom.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #include "gsm.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #include <stdio.h>
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #include <string.h>
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #include "mfw_mfw.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #include "mfw_sys.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #include "mfw_tim.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #include "drv_key.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #include "mfw_win.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include "mfw_kbd.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #ifndef NEPTUNE_BOARD
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 /* END ADD: Req ID: : Sumit : 14-Mar-05 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "kpd/kpd_api.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #include "ti1_key.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 #endif /* NEPTUNE_BOARD*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 /* END ADD: Req ID: : Sumit : 14-Mar-05 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 #include "mfw_ffs.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 #include "mfw_utils.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #include "mfw_mme.h"
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 static int kbdCommand (U32 cmd, void *h);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 static int toLong (U32 t, void *h);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 static int toAuto (U32 t, void *h);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 static MfwCb doAlways; /* all cases handler */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 static MfwHdr timLongH; /* the long press timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 static MfwTim timLong;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 static MfwHdr timAutoH; /* the auto repeat timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 static MfwTim timAuto;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 static U32 valAuto; /* auto start intervall */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 static U32 valRepeat; /* auto repeat intervall */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 static U32 curMap; /* current key map */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 static U8 curKey; /* current key code */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 static int still_processing_flag;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 // PATCH LE 06.06.00
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 // current MFW element needed for multiple instances
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 EXTERN MfwHdr * current_mfw_elem;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 // END PATCH LE 06.06.00
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 ** KeyPress Buffer Macros and Limits
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 // Apr 03, 2005 REF: CRR 29988 - xpradipg
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 // Keyboard buffer reduced from 50 to 20
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 #ifdef FF_MMI_REDUCED_KBD_BUFFER
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 #define MAX_KPRESS_BFR 20
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 #define MAX_KPRESS_BFR 50
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 typedef struct keyPressDetailsTag {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 char make;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 char key;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 } keyPressDetails;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 // Sep 18, 2006 REF: OMAPS00094426 - x0039928
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 #if(BOARD == 71)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 UBYTE kpd_key;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 static keyPressDetails keyPressBfr[MAX_KPRESS_BFR];
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 static SHORT mfw_kbd_kpress_buf_id;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 extern void sendKeyInd( T_KPD_VIRTUAL_KEY_ID virtual_key_id,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 T_KPD_KEY_STATE key_state,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 T_KPD_PRESS_STATE press_state);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 extern char drvGetKeyIndex( char key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 | STATE : code ROUTINE : kbdInit |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 PURPOSE : initialize keyboard handler
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 MfwRes kbdInit (void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 timLong.time = 0; /* setup long press timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 timLong.left = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 timLong.handler = toLong;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 timLong.next = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 timLongH.data = &timLong;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 timLongH.type = MfwTypTim;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 timAuto.time = 0; /* setup auto repeat timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 timAuto.left = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 timAuto.handler = toAuto;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 timAuto.next = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 timAutoH.data = &timAuto;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 timAutoH.type = MfwTypTim;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 valAuto = valRepeat = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 keyInit(kbdSignal); /* init keyboard driver */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 mfwCommand[MfwTypKbd] = (MfwCb) kbdCommand;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 doAlways = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 mfw_kbd_kpress_buf_id = mfw_cbuf_create(MAX_KPRESS_BFR,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 sizeof(keyPressDetails),
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 FALSE,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 0xFF,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 TRUE,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 keyPressBfr);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 if (mfw_kbd_kpress_buf_id < 0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 TRACE_EVENT_P1("ERROR : mfw_cbuf_create failed with error value %d", mfw_kbd_kpress_buf_id);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 return MfwResOk;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 | STATE : code ROUTINE : kbdExit |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 PURPOSE : finalize keyboard handler
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 MfwRes kbdExit (void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 mfwCommand[MfwTypKbd] = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 keyExit();
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 return MfwResOk;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 | STATE : code ROUTINE : kbdAlways |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 PURPOSE : create keyboard control for all events
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 MfwCb kbdAlways (MfwCb f)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 MfwCb always = doAlways;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 doAlways = f;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 if (!f)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 timStop(&timLongH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 timStop(&timAutoH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 return always;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 | STATE : code ROUTINE : kbdTime |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 PURPOSE : define keyboard timeouts
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 void kbdTime (long tLong, long tAuto, long tRepeat)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 timLong.time = tLong; /* setup long press timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 timAuto.time = tAuto; /* setup auto repeat timer */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 valAuto = tAuto; /* save auto start timeout */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 valRepeat = tRepeat; /* save repeat intervall */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 | STATE : code ROUTINE : kbdCreate |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 PURPOSE : create keyboard control
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 MfwHnd kbdCreate (MfwHnd w, MfwEvt e, MfwCb f)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 MfwHdr *hdr = (MfwHdr *) mfwAlloc(sizeof(MfwHdr));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 MfwKbd *kbd = (MfwKbd *) mfwAlloc(sizeof(MfwKbd));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 MfwHdr *insert_status =0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 if (!hdr || !kbd)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 TRACE_ERROR("ERROR: kbdCreate() Mem Alloc Failed.");
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 if(hdr)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 mfwFree((U8*)hdr,sizeof(MfwHdr));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 if(kbd)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 mfwFree((U8*)kbd,sizeof(MfwKbd));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 kbd->map = e;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 kbd->key = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 kbd->handler = f;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 hdr->data = kbd;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 hdr->type = MfwTypKbd;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 insert_status = mfwInsert(w,hdr);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 if(!insert_status)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 TRACE_ERROR("ERROR: kbdCreate() Failed to Install Handler. ");
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 mfwFree((U8*)hdr,sizeof(MfwHdr));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 mfwFree((U8*)kbd ,sizeof(MfwKbd));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 return insert_status;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 | STATE : code ROUTINE : kbdDelete |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 PURPOSE : delete keyboard control
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 MfwRes kbdDelete (MfwHnd h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 MfwRes res;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 if (!h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 return MfwResIllHnd;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 res = (mfwRemove(h)) ? MfwResOk : MfwResIllHnd;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 mfwFree(((MfwHdr *) h)->data,sizeof(MfwKbd));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 mfwFree(h,sizeof(MfwHdr));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 return res;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 | STATE : code ROUTINE : sigExec |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 PURPOSE : execute keyboard signal
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 if the registered set of keys match the currently
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 pressed key, the event handler is called, if the
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 registered flags match the current flags according
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 to the following table:
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 M: Make/Break (key release events wanted)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 L: Long press event (timeout set via kbdTime())
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 A: Auto repeat event (timing defined via kbdTime())
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 M 0 0 0 0 1 1 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 current event flags --------- L 0 0 0 0 0 0 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 A 0 0 0 0 0 1 0 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 M L A .................
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 0 0 0 . 0 0 0 0 1 0 0 0
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 0 0 1 . 0 0 0 0 1 1 0 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 registered 0 1 0 . 0 0 0 0 0 0 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 event ----------- 0 1 1 . 0 0 0 0 0 1 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 flags 1 0 0 . 1 1 1 1 1 0 0 0
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 1 0 1 . 1 1 1 1 1 1 0 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 1 1 0 . 1 1 1 1 0 0 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 1 1 1 . 1 1 1 1 0 1 1 1
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 static int sigExec (MfwHdr *curElem, U32 map, U8 key)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 MfwKbd *kc;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 while (curElem)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 if (curElem->type == MfwTypKbd)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 kc = curElem->data;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 if (kc->map & map & ~KEY_FLAGS)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 { /* keys match */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 kc->code = key; /* set current key code */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 if (map & KEY_MAKE)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 kc->key |= map; /* set key in control block */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 kc->key &= ~map; /* del key in control block */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 kc->key &= ~KEY_MAKE; /* del make/break flag */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 if ((KEY_MAKE & ~map & kc->map) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 (KEY_MAKE & map &&
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 ((KEY_LONG & map & kc->map) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 (!(KEY_LONG & kc->map)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 && (KEY_AUTO & kc->map & map)) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 (!(KEY_LONG & map)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 && !(KEY_AUTO & map)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 && !(KEY_LONG & kc->map)) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 (!(KEY_LONG & map)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 && (KEY_AUTO & map)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 && (KEY_AUTO & kc->map)))))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 if (kc->handler) /* handler valid */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 // PATCH LE 06.06.00
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 // store current mfw elem
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 current_mfw_elem = curElem;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 // END PATCH LE 06.06.00
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 if ((*(kc->handler))(map,kc))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 return 1; /* event consumed */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 curElem = curElem->next;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 | STATE : code ROUTINE : sigDistribute |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 PURPOSE : distribute keyboard event
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 static void sigDistribute (U32 map, U8 key)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 int res = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 TRACE_EVENT("sigDistribute");
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 if (doAlways)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 if (doAlways(map,(void*) -1))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 return; /* event consumed */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 if (mfwSignallingMethod == 0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 if (mfwFocus)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 res = sigExec(mfwFocus,map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 if (!res && mfwRoot)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 res = sigExec(mfwRoot,map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 MfwHdr *h = mfwFocus;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 if (!h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 h = mfwRoot;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 while (h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 res = sigExec(h,map,key); /* Warning correction - x0020906 - 14-08-2006*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 if (res)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 if (h == mfwRoot)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 h = mfwParent(mfwParent(h));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 if (h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 h = ((MfwWin *)(h->data))->elems;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 if (!res && mfwRoot && h != mfwRoot)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 res = sigExec(mfwRoot,map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 if (doAlways)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 (void)(doAlways(map,(void*) res));/*a0393213 lint warnings removal - void cast is done to avoid lint warning though the function returns int*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 return;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 | STATE : code ROUTINE : kbdSignal |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 PURPOSE : keyboard event (called by driver/PEI)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 #define MAX_CONSEC_KEYS 6 // Maximum number of keys which can be processed before
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 // allowing the protocol stack processing time
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 //xrashmic 22 Aug, 2004 MMI-SPR-32798
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 #ifdef MMI_EM_ENABLED
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 #ifndef NEPTUNE_BOARD
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 /* This is not valid for Neptune Engineering Mode, hence*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 extern U8 screenCaptureKey;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 void screen_capture(void);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 #endif /* ifndef NEPTUNE_BOARD */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 void kbdSignal (char make, char key)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 U32 map;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 UBYTE temp=0 ;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 USHORT numElem;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 int loopNo;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 int keyNo;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 if ((kbd_processKeyInput()== QUEUE_EVERY_KEY) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 (kbd_processKeyInput()== QUEUE_N_KEYS))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 temp = dspl_Enable(0);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 mme_backlightEvent(BL_KEY_PRESS);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 loopNo = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 keyNo = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 while (kbd_getMakeAndKey(&make,&key) != -1)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 #ifdef MMI_EM_ENABLED
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 #ifndef NEPTUNE_BOARD
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 /* This is not valid for Neptune Engineering Mode, hence*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 //xrashmic 22 Aug, 2004 MMI-SPR-32798
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 //If screen capture is enabled the key pressed is the screen capture key,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 //we write the LCD buffer into the FFS and and consume the key
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 //event here itself without sending it to BMI
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 // Also the screen capture key will be disabled here
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 if(key== screenCaptureKey && make==1)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 TRACE_EVENT("*****Capturing the screen");
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 screenCaptureKey=KCD_NONE;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 screen_capture();
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 dspl_Enable(temp);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 return;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 #endif /* ifndef NEPTUNE_BOARD*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 still_processing_flag = 1;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 TRACE_EVENT_P2("NDH : KbdSignal - key %d, state %02x", key, make);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 if (key <= KCD_MAX) /*a0393213 compiler warnings removal - comparison of key with 0 removed*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 loopNo++;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 keyNo++;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 map = 1L << key;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 if (make)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 map |= KEY_MAKE;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 curMap = map;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 curKey = key;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 timStart(&timLongH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 timAuto.time = valAuto;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 /*NM, p007a*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 if (valAuto)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 timStart(&timAutoH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 /*NM, p007a end*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 map &= ~KEY_MAKE;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 curMap = map; //ES!!
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 curKey = key; //ES!!
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 timStop(&timLongH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 if (valAuto)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 timStop(&timAutoH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 //Select when we update the display
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 switch (kbd_processKeyInput())
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 case QUEUE_EVERY_KEY:
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 sigDistribute(map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 case PROCESS_EVERY_KEY:
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 temp = dspl_Enable(0);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 sigDistribute(map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 dspl_Enable(temp);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 case QUEUE_N_KEYS:
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 if ((loopNo %(NUM_QUEUE_KEYS*2))==0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 kbd_setDisplayUpdateNeeded(1);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 sigDistribute(map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 dspl_Enable(temp);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 temp = dspl_Enable(0);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 kbd_setDisplayUpdateNeeded(0);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 sigDistribute(map,key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 if (keyNo == MAX_CONSEC_KEYS)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 still_processing_flag = FALSE;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 still_processing_flag = FALSE;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 numElem = mfw_cbuf_num_elements(mfw_kbd_kpress_buf_id);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 /* x0083025 on Sep 14, 2007 for OMAPS00145862 (adrian) */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 MMI_TRACE_EVENT_P2("NDH >>> Kbd :- There are %d elements in the buffer (id : %d)" ,
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 numElem, mfw_kbd_kpress_buf_id);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 if ((keyNo == MAX_CONSEC_KEYS) && (numElem > 0))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 sendKeyInd(0, 0, 0); // dummy values to trigger another keypress_ind
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 ** This delay is required to slow down the BMI when no trace is being output in order
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 ** to permit the Protocol Stack & other tasks to function correctly
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 vsi_t_sleep (VSI_CALLER 30);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 if ((kbd_processKeyInput()== QUEUE_EVERY_KEY) ||
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 (kbd_processKeyInput()== QUEUE_N_KEYS))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 dspl_Enable(temp);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 return;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 | STATE : code ROUTINE : toLong |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 PURPOSE : long press timeout handler
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 static int toLong (U32 t, void *h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 // Sep 18, 2006 REF: OMAPS00094426 - x0039928
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 // Fix: On long key press timer expiry bsp kpd status is checked to see if the state is
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 // in in Kpd pressed state and sets the long key bit.
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 #if(BOARD == 71)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 UBYTE state;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 kpd_retrieve_key_status(kpd_key, KPD_DEFAULT_MODE, &state);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 if(!state)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 curMap |= KEY_LONG;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 sigDistribute(curMap,curKey);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 | STATE : code ROUTINE : toAuto |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 PURPOSE : auto repeat timeout handler
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 static int toAuto (U32 t, void *h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 #if(BOARD == 71)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 UBYTE state;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 kpd_retrieve_key_status(kpd_key, KPD_DEFAULT_MODE, &state);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 if(!state)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 curMap |= KEY_AUTO;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 sigDistribute(curMap,curKey);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 timAuto.time = valRepeat;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 /* NM p007c*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 if (valRepeat)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654 timStart(&timAutoH);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 /* NM p007c end*/
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 #if(BOARD == 71)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 #endif
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 | STATE : code ROUTINE : kbdCommand |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 PURPOSE : handle mfw windows command
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 static int kbdCommand (U32 cmd, void *h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 switch (cmd)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 case MfwCmdDelete: /* delete me */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 if (!h)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 kbdDelete(h);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 return 1;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 default:
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 break;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 return 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 | STATE : code ROUTINE : kbd_putMakeAndKey |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 PURPOSE : places 'make' (key up/down) and key index into a queue
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 int kbd_putMakeAndKey( char make, char key)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 keyPressDetails localKP;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 SHORT retVal;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 localKP.make = make;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 localKP.key = key;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 retVal = mfw_cbuf_put(mfw_kbd_kpress_buf_id, &localKP);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 if (retVal < 0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error value %d", retVal);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 return (retVal);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 | STATE : code ROUTINE : kbd_getMakeAndKey |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 PURPOSE : reads 'make' (key up/down) and key index into a queue
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 Return +ve number - keys left in buffer
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 0 - no keys left - last key press returned
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 -1 - no keys and none in buffer
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 int kbd_getMakeAndKey( char* make, char* key)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 keyPressDetails localKP;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 SHORT retVal;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 retVal = mfw_cbuf_get(mfw_kbd_kpress_buf_id, &localKP);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 if (retVal < 0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 *key = 0x7F;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 *make = 0;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 return (-1);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 *make = !(localKP.make);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 *key = drvGetKeyIndex(localKP.key);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 return (mfw_cbuf_num_elements(mfw_kbd_kpress_buf_id));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 | STATE : code ROUTINE : kbd_getNumElements |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753 PURPOSE : returns number of elements in queue
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 int kbd_getNumElements(void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 return ((int)mfw_cbuf_num_elements(mfw_kbd_kpress_buf_id));
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 int kbd_stillProcessingKeys(void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 return (still_processing_flag);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 int mfwKey_skipDisplay( void )
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768 if ((mfw_cbuf_num_elements(mfw_kbd_kpress_buf_id) > 2) && (still_processing_flag == 1))
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 return (TRUE);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 return (FALSE);
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777 | STATE : code ROUTINE : kbd_displayUpdateNeeded |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 PURPOSE : returns TRUE if we need to update the display
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 int displayUpdateNeeded; //used for output every 'n' key presses
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784 int kbd_displayUpdateNeeded(void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786 if (kbd_processKeyInput()==PROCESS_EVERY_KEY)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 return (TRUE);//Processing each key press - always update screen
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788 else if (displayUpdateNeeded==0)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 return (TRUE);//need to update the display (1 in 6 output)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 else if (mfw_cbuf_num_elements(mfw_kbd_kpress_buf_id) > 1)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 return (FALSE);//keys in queue - do not update
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 else
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 return (TRUE);//only 1 key up/down in queue - update display
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 | STATE : code ROUTINE : kbd_setDisplayUpdateNeeded |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 PURPOSE : sets/clears the flag indicating we need to update the display
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 void kbd_setDisplayUpdateNeeded(int set)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 displayUpdateNeeded = set;
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 /*
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 | PROJECT : MMI-Framework (8417) MODULE : MFW_KBD |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 | STATE : code ROUTINE : kbd_processEveryKeyInput |
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813 +--------------------------------------------------------------------+
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 PURPOSE : indicates if the software should process each keypad input individually
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 (TRUE) or if it should process keypad inputs one at a time (FALSE)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 */
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 int kbd_processKeyInput(void)
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 {
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821 return (QUEUE_EVERY_KEY);//We buffer multiple key inputs
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 }
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829
e8ddbb0837ed src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830