diff options
author | Nicolas Aguirre <aguirre.nicolas@gmail.com> | 2013-12-11 00:13:59 +0100 |
---|---|---|
committer | Cedric BAIL <c.bail@partner.samsung.com> | 2014-06-18 11:34:06 +0200 |
commit | c7993e2cb4d9f4620311707892383a36c0b30b2f (patch) | |
tree | 35885cc8ef7ea2c7570fc6cd73d1b843f057be9e | |
parent | 5885bfcb2e0acf81c3c905ebdb30ab48211ac950 (diff) | |
download | efl-c7993e2cb4d9f4620311707892383a36c0b30b2f.tar.gz |
ecore_cocoa: fix Key up/down usage, the event window was missing and the ev->key was not specified
-rw-r--r-- | src/lib/ecore_cocoa/ecore_cocoa.m | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m index 5d8e2882cf..2cc5b73bbf 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa.m +++ b/src/lib/ecore_cocoa/ecore_cocoa.m @@ -169,6 +169,7 @@ ecore_cocoa_feed_events(void) { Ecore_Event_Key *ev; unsigned int i; + EcoreCocoaWindow *window = (EcoreCocoaWindow *)[event window]; ev = calloc(1, sizeof (Ecore_Event_Key)); if (!ev) return; @@ -178,10 +179,12 @@ ecore_cocoa_feed_events(void) { if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0])) { - printf("Key pressed : %s\n", keystable[i].name); + printf("Key pressed : %s\n", keystable[i].name); ev->keyname = keystable[i].name; + ev->key = keystable[i].name; ev->string = keystable[i].compose; - + ev->window = window.ecore_window_data; + ev->event_window = ev->window; ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL); return; } @@ -193,6 +196,9 @@ ecore_cocoa_feed_events(void) { Ecore_Event_Key *ev; unsigned int i; + EcoreCocoaWindow *window = (EcoreCocoaWindow *)[event window]; + + printf("Key Up\n"); ev = calloc(1, sizeof (Ecore_Event_Key)); if (!ev) return; @@ -203,8 +209,10 @@ ecore_cocoa_feed_events(void) if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0])) { ev->keyname = keystable[i].name; + ev->key = keystable[i].name; ev->string = keystable[i].compose; - + ev->window = window.ecore_window_data; + ev->event_window = ev->window; ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL); return; } |