Ecore Cocoa: Add missing modifiers field to Ecore Events

Fix T4477
This commit is contained in:
Guilherme Iscaro 2016-10-08 17:29:08 -03:00
parent 0897715c8d
commit 186dd9b00e
3 changed files with 9 additions and 4 deletions

View File

@ -90,8 +90,8 @@ ecore_cocoa_shutdown(void)
return _ecore_cocoa_init_count; return _ecore_cocoa_init_count;
} }
static unsigned int unsigned int
_ecore_cocoa_event_modifiers(NSUInteger mod) ecore_cocoa_event_modifiers(NSUInteger mod)
{ {
unsigned int modifiers = 0; unsigned int modifiers = 0;
@ -134,7 +134,7 @@ _ecore_cocoa_event_key(NSEvent *event,
} }
ev->timestamp = time; ev->timestamp = time;
ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]); ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
ev->keycode = event.keyCode; ev->keycode = event.keyCode;
ev->string = [keycharRaw cStringUsingEncoding:NSUTF8StringEncoding]; ev->string = [keycharRaw cStringUsingEncoding:NSUTF8StringEncoding];
@ -334,7 +334,7 @@ _ecore_cocoa_feed_events(void *anEvent)
ev->window = (Ecore_Window)window.ecore_window_data; ev->window = (Ecore_Window)window.ecore_window_data;
ev->event_window = ev->window; ev->event_window = ev->window;
ev->modifiers = 0; /* FIXME: keep modifier around. */ ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
ev->timestamp = time; ev->timestamp = time;
if (dy != 0) if (dy != 0)
{ {

View File

@ -79,6 +79,8 @@ Eina_Bool _ecore_cocoa_window_init(void);
Eina_Bool _ecore_cocoa_feed_events(void *anEvent); Eina_Bool _ecore_cocoa_feed_events(void *anEvent);
unsigned int ecore_cocoa_event_modifiers(NSUInteger mod);
#endif #endif

View File

@ -215,6 +215,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
else else
ev->triple_click = 0; ev->triple_click = 0;
ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL); ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
} }
@ -272,6 +273,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
else else
ev->triple_click = 0; ev->triple_click = 0;
ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
} }
@ -312,6 +314,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
ev->multi.x = ev->x; ev->multi.x = ev->x;
ev->multi.y = ev->y; ev->multi.y = ev->y;
ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
} }