summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>2015-10-15 11:13:53 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-10 08:32:49 +0100
commitd12ded45d63e4c0c3d6873abcc61707b6971fc1a (patch)
tree2a8a484ef3b5ff39d80931560d23261789a74187
parentbf025100249a1450b57e0e677f2aaba8e35f9a8e (diff)
ecore_cocoa: factorize code
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index ed17fd753f..55a7f70602 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -104,7 +104,8 @@ _ecore_cocoa_event_modifiers(NSUInteger mod)
104 104
105static Ecore_Event_Key* 105static Ecore_Event_Key*
106_ecore_cocoa_event_key(NSEvent *event, 106_ecore_cocoa_event_key(NSEvent *event,
107 NSEventType keyType) 107 NSEventType keyType,
108 unsigned int time)
108{ 109{
109 static Eina_Bool compose = EINA_FALSE; 110 static Eina_Bool compose = EINA_FALSE;
110 static NSText *edit; 111 static NSText *edit;
@@ -127,6 +128,7 @@ _ecore_cocoa_event_key(NSEvent *event,
127 compose=EINA_FALSE; 128 compose=EINA_FALSE;
128 } 129 }
129 130
131 ev->timestamp = time;
130 ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]); 132 ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]);
131 133
132 ev->keycode = event.keyCode; 134 ev->keycode = event.keyCode;
@@ -197,10 +199,9 @@ ecore_cocoa_feed_events(void *anEvent)
197 { 199 {
198 Ecore_Event_Key *ev; 200 Ecore_Event_Key *ev;
199 201
200 ev = _ecore_cocoa_event_key(event, NSKeyDown); 202 ev = _ecore_cocoa_event_key(event, NSKeyDown, time);
201 if (ev == NULL) return EINA_TRUE; 203 if (ev == NULL) return EINA_TRUE;
202 204
203 ev->timestamp = time;
204 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL); 205 ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
205 206
206 break; 207 break;
@@ -209,10 +210,9 @@ ecore_cocoa_feed_events(void *anEvent)
209 { 210 {
210 Ecore_Event_Key *ev; 211 Ecore_Event_Key *ev;
211 212
212 ev = _ecore_cocoa_event_key(event, NSKeyUp); 213 ev = _ecore_cocoa_event_key(event, NSKeyUp, time);
213 if (ev == NULL) return EINA_TRUE; 214 if (ev == NULL) return EINA_TRUE;
214 215
215 ev->timestamp = time;
216 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL); 216 ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
217 217
218 break; 218 break;