summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-05 14:18:29 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-05 14:18:29 +0000
commita79dbaf28671a078393170fb09d207a1d5a22d29 (patch)
tree3343594d74ce2f7ce3fd301e38dd253362b5de0d /legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
parentc18872df7811fe24e3faf47011c4fd5f95ece27f (diff)
fix ecore-fb.. so terminology works 100% perfectly in fb!
SVN revision: 73354
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c77
1 files changed, 43 insertions, 34 deletions
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
index bc28261a49..3c37120231 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
@@ -11,7 +11,7 @@
11 11
12static Eina_List *_ecore_fb_li_devices = NULL; 12static Eina_List *_ecore_fb_li_devices = NULL;
13 13
14static const char *_ecore_fb_li_kbd_syms[128 * 6] = 14static const char *_ecore_fb_li_kbd_syms[128 * 7] =
15{ 15{
16#include "ecore_fb_keytable.h" 16#include "ecore_fb_keytable.h"
17}; 17};
@@ -46,31 +46,33 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
46 if ((iev->code >= KEY_ESC) && (iev->code <= KEY_COMPOSE)) 46 if ((iev->code >= KEY_ESC) && (iev->code <= KEY_COMPOSE))
47 { 47 {
48 int offset = 0; 48 int offset = 0;
49 const char *keyname = _ecore_fb_li_kbd_syms[iev->code * 6]; 49 const char *keyname = _ecore_fb_li_kbd_syms[iev->code * 7];
50
50 /* check the key table */ 51 /* check the key table */
51 if (iev->value) 52 if (iev->value)
52 { 53 {
53 /* its a repeated key, dont increment */ 54 /* its a repeated key, dont increment */
54 if (iev->value == 2) 55 if (iev->value != 2)
55 return; 56 {
56 if (!strcmp(keyname, "Control_L")) 57 if (!strcmp(keyname, "Control_L"))
57 dev->keyboard.ctrl++; 58 dev->keyboard.ctrl++;
58 else if (!strcmp(keyname, "Control_R")) 59 else if (!strcmp(keyname, "Control_R"))
59 dev->keyboard.ctrl++; 60 dev->keyboard.ctrl++;
60 else if (!strcmp(keyname, "Alt_L")) 61 else if (!strcmp(keyname, "Alt_L"))
61 dev->keyboard.alt++; 62 dev->keyboard.alt++;
62 else if (!strcmp(keyname, "Alt_R")) 63 else if (!strcmp(keyname, "Alt_R"))
63 dev->keyboard.alt++; 64 dev->keyboard.alt++;
64 else if (!strcmp(keyname, "Shift_L")) 65 else if (!strcmp(keyname, "Shift_L"))
65 dev->keyboard.shift++; 66 dev->keyboard.shift++;
66 else if (!strcmp(keyname, "Shift_R")) 67 else if (!strcmp(keyname, "Shift_R"))
67 dev->keyboard.shift++; 68 dev->keyboard.shift++;
68 else if (!strcmp(keyname, "Caps_Lock")) 69 else if (!strcmp(keyname, "Caps_Lock"))
69 dev->keyboard.lock = !dev->keyboard.lock; 70 dev->keyboard.lock = !dev->keyboard.lock;
70 if (dev->keyboard.ctrl > 2) dev->keyboard.ctrl = 2; 71 if (dev->keyboard.ctrl > 2) dev->keyboard.ctrl = 2;
71 if (dev->keyboard.alt > 2) dev->keyboard.alt = 2; 72 if (dev->keyboard.alt > 2) dev->keyboard.alt = 2;
72 if (dev->keyboard.shift > 2) dev->keyboard.shift = 2; 73 if (dev->keyboard.shift > 2) dev->keyboard.shift = 2;
73 if (dev->keyboard.lock > 1) dev->keyboard.lock = 1; 74 if (dev->keyboard.lock > 1) dev->keyboard.lock = 1;
75 }
74 } 76 }
75 else 77 else
76 { 78 {
@@ -98,8 +100,15 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
98 if (dev->keyboard.shift) offset = 1; 100 if (dev->keyboard.shift) offset = 1;
99 else if (dev->keyboard.lock) offset = 2; 101 else if (dev->keyboard.lock) offset = 2;
100 102
101 const char *key = _ecore_fb_li_kbd_syms[(iev->code * 6) + offset]; 103 const char *key = _ecore_fb_li_kbd_syms[(iev->code * 7) + offset];
102 const char *compose = _ecore_fb_li_kbd_syms[(iev->code * 6) + 3 + offset]; 104 const char *compose = _ecore_fb_li_kbd_syms[(iev->code * 7) + 3 + offset];
105
106 if (dev->keyboard.ctrl)
107 {
108 const char *ts = _ecore_fb_li_kbd_syms[(iev->code * 7) + 3 + 3];
109
110 if (ts) compose = ts;
111 }
103 112
104 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + 113 e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) +
105 strlen(keyname) + (compose ? strlen(compose) : 0) + 3); 114 strlen(keyname) + (compose ? strlen(compose) : 0) + 3);
@@ -210,21 +219,21 @@ _ecore_fb_li_device_event_rel(Ecore_Fb_Input_Device *dev, struct input_event *ie
210 case REL_Y: 219 case REL_Y:
211 { 220 {
212 Ecore_Event_Mouse_Move *e; 221 Ecore_Event_Mouse_Move *e;
213 if(iev->code == REL_X) 222 if (iev->code == REL_X)
214 { 223 {
215 dev->mouse.x += iev->value; 224 dev->mouse.x += iev->value;
216 if(dev->mouse.x > dev->mouse.w - 1) 225 if (dev->mouse.x > dev->mouse.w - 1)
217 dev->mouse.x = dev->mouse.w; 226 dev->mouse.x = dev->mouse.w;
218 else if(dev->mouse.x < 0) 227 else if(dev->mouse.x < 0)
219 dev->mouse.x = 0; 228 dev->mouse.x = 0;
220 } 229 }
221 else 230 else
222 { 231 {
223 dev->mouse.y += iev->value; 232 dev->mouse.y += iev->value;
224 if(dev->mouse.y > dev->mouse.h - 1) 233 if (dev->mouse.y > dev->mouse.h - 1)
225 dev->mouse.y = dev->mouse.h; 234 dev->mouse.y = dev->mouse.h;
226 else if(dev->mouse.y < 0) 235 else if(dev->mouse.y < 0)
227 dev->mouse.y = 0; 236 dev->mouse.y = 0;
228 } 237 }
229 238
230 e = calloc(1, sizeof(Ecore_Event_Mouse_Move)); 239 e = calloc(1, sizeof(Ecore_Event_Mouse_Move));
@@ -314,7 +323,7 @@ _ecore_fb_li_device_event_abs(Ecore_Fb_Input_Device *dev, struct input_event *ie
314 break; 323 break;
315 324
316 case ABS_Y: 325 case ABS_Y:
317 if(dev->mouse.h != 0) 326 if (dev->mouse.h != 0)
318 { 327 {
319 int tmp; 328 int tmp;
320 329
@@ -537,8 +546,8 @@ ecore_fb_input_device_open(const char *dev)
537 /* set info */ 546 /* set info */
538 for (event_type = 0; event_type < EV_MAX; event_type++) 547 for (event_type = 0; event_type < EV_MAX; event_type++)
539 { 548 {
540 if(!test_bit(event_type, event_type_bitmask)) 549 if (!test_bit(event_type, event_type_bitmask))
541 continue; 550 continue;
542 switch (event_type) 551 switch (event_type)
543 { 552 {
544 case EV_SYN: 553 case EV_SYN: