Browse Source

Implemented CMD+Q shortcut

Thomas Buck 11 years ago
parent
commit
24ea239a61
4 changed files with 20 additions and 1 deletions
  1. 1
    0
      ChangeLog
  2. 9
    0
      src/OpenRaider.cpp
  3. 6
    0
      src/SDLSystem.cpp
  4. 4
    1
      src/System.h

+ 1
- 0
ChangeLog View File

6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7
 
7
 
8
 	[ 20140101 ]
8
 	[ 20140101 ]
9
+	* Implemented CMD + Q shortcut on Mac to quit
9
 	* Added bool mFirstMouseEvent to SDLSystem used to ignore
10
 	* Added bool mFirstMouseEvent to SDLSystem used to ignore
10
 	  the first received mouse event, because its faulty, thanks
11
 	  the first received mouse event, because its faulty, thanks
11
 	  to an SDL bug:
12
 	  to an SDL bug:

+ 9
- 0
src/OpenRaider.cpp View File

744
 			toggleFullscreen();
744
 			toggleFullscreen();
745
 		}
745
 		}
746
 		break;
746
 		break;
747
+
748
+#ifdef __APPLE__
749
+    // Handle CMD+Q to quit
750
+    case 'q':
751
+        if (mod & SYS_MOD_KEY_LMETA) {
752
+            shutdown(0);
753
+        }
754
+        break;
755
+#endif
747
 	}
756
 	}
748
 
757
 
749
 	////////////////////////////////////////////////////////////
758
 	////////////////////////////////////////////////////////////

+ 6
- 0
src/SDLSystem.cpp View File

399
 				if (mkeys & KMOD_RALT)
399
 				if (mkeys & KMOD_RALT)
400
 					mod |= SYS_MOD_KEY_RALT;
400
 					mod |= SYS_MOD_KEY_RALT;
401
 
401
 
402
+                if (mkeys & KMOD_LMETA)
403
+					mod |= SYS_MOD_KEY_LMETA;
404
+
405
+				if (mkeys & KMOD_RMETA)
406
+					mod |= SYS_MOD_KEY_RMETA;
407
+
402
 				key = event.key.keysym.sym;
408
 				key = event.key.keysym.sym;
403
 				specialKey = false;
409
 				specialKey = false;
404
 
410
 

+ 4
- 1
src/System.h View File

62
   SYS_MOD_KEY_LCTRL  = 4,
62
   SYS_MOD_KEY_LCTRL  = 4,
63
   SYS_MOD_KEY_RCTRL  = 8,
63
   SYS_MOD_KEY_RCTRL  = 8,
64
   SYS_MOD_KEY_LALT   = 16,
64
   SYS_MOD_KEY_LALT   = 16,
65
-  SYS_MOD_KEY_RALT   = 32
65
+  SYS_MOD_KEY_RALT   = 32,
66
+
67
+  SYS_MOD_KEY_LMETA = 64,
68
+  SYS_MOD_KEY_RMETA = 128,
66
 
69
 
67
 } sdl_sys_mod_key_t;
70
 } sdl_sys_mod_key_t;
68
 
71
 

Loading…
Cancel
Save