From 29f9b2a95d21173abb885e97f583787dd4422e61 Mon Sep 17 00:00:00 2001 From: Jean Guyomarc'h Date: Thu, 15 Oct 2015 11:13:53 +0200 Subject: [PATCH] ecore_cocoa: factorize code Change-Id: I254bce4a7f8e5fd5ac0ad01bcc9d7ae98a8420ee Signed-off-by: Cedric BAIL --- src/lib/ecore_cocoa/ecore_cocoa.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m index c16cf51..80d351e 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; -- 2.7.4