aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>2015-10-15 11:13:53 +0200
committerChris Michael <cp.michael@samsung.com>2015-12-03 11:31:05 -0500
commit908b97243eeacf2b3f49f656767f14c80d00cb72 (patch)
treea9c4daecac74bedee7263b778718e268ba46fe3c
parentevas_gl_cocoa: make sure focus is always unlocked after locking it (diff)
downloadefl-908b97243eeacf2b3f49f656767f14c80d00cb72.tar.gz
ecore_cocoa: factorize code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-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)
static Ecore_Event_Key*
_ecore_cocoa_event_key(NSEvent *event,
- NSEventType keyType)
+ NSEventType keyType,
+ unsigned int time)
{
static Eina_Bool compose = EINA_FALSE;
static NSText *edit;
@@ -127,6 +128,7 @@ _ecore_cocoa_event_key(NSEvent *event,
compose=EINA_FALSE;
}
+ ev->timestamp = time;
ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]);
ev->keycode = event.keyCode;
@@ -197,10 +199,9 @@ ecore_cocoa_feed_events(void *anEvent)
{
Ecore_Event_Key *ev;
- ev = _ecore_cocoa_event_key(event, NSKeyDown);
+ ev = _ecore_cocoa_event_key(event, NSKeyDown, time);
if (ev == NULL) return EINA_TRUE;
- ev->timestamp = time;
ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
break;
@@ -209,10 +210,9 @@ ecore_cocoa_feed_events(void *anEvent)
{
Ecore_Event_Key *ev;
- ev = _ecore_cocoa_event_key(event, NSKeyUp);
+ ev = _ecore_cocoa_event_key(event, NSKeyUp, time);
if (ev == NULL) return EINA_TRUE;
- ev->timestamp = time;
ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
break;