thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=db8b0020ecc761a6729049ceed1d9f68f528dbbb

commit db8b0020ecc761a6729049ceed1d9f68f528dbbb
Author: Thiep Ha <thie...@gmail.com>
Date:   Fri Sep 23 17:49:34 2016 +0900

    ecore_cocoa: quit application with key
    
    In OS X, cmd-q is used to quit application,
    this patch adds that feature.
---
 src/lib/ecore_cocoa/ecore_cocoa.m | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m 
b/src/lib/ecore_cocoa/ecore_cocoa.m
index ee1188d..2cf1739 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -202,6 +202,18 @@ _ecore_cocoa_feed_events(void *anEvent)
       case NSKeyDown:
         {
            Ecore_Event_Key *ev;
+           NSUInteger flags = [event modifierFlags];
+
+           if (flags & NSCommandKeyMask)
+             {
+                NSString *keychar = [event charactersIgnoringModifiers];
+                if ([keychar characterAtIndex:0] == 'q')
+                  {
+                     [NSApp performSelector:@selector(terminate:)
+                                            withObject:nil afterDelay:0.0];
+                     return EINA_TRUE;
+                  }
+             }
 
            ev = _ecore_cocoa_event_key(event, NSKeyDown, time);
            if (ev == NULL) return EINA_TRUE;

-- 


Reply via email to