From e3d0f74cdc00ab6ecc2eeed241b18fea40550094 Mon Sep 17 00:00:00 2001 From: jdolan Date: Thu, 12 Sep 2013 12:16:43 -0400 Subject: [PATCH] Rather than trod on X11 keysyms, just check the meta keys in addition to the alt keys in Sys_AltDown. This way, if someone has a working X11 on Mac and they prefer to actually use their Alt keys, they can. The rest of us can use Cmd. --- radiant/qe3.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index bd0bab5c..d99127e8 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -1212,11 +1212,6 @@ bool Sys_AltDown(){ XQueryKeymap( GDK_DISPLAY(), keys ); -#if defined ( __APPLE__ ) -#define XK_Alt_L XK_Meta_L -#define XK_Alt_R XK_Meta_R -#endif - x = XKeysymToKeycode( GDK_DISPLAY(), XK_Alt_L ); if ( keys[x / 8] & ( 1 << ( x % 8 ) ) ) { return true; @@ -1227,6 +1222,17 @@ bool Sys_AltDown(){ return true; } + // For Apple, let users use their Command keys since Alt + X11 is hosed + x = XKeysymToKeycode( GDK_DISPLAY(), XK_Meta_L ); + if ( keys[x / 8] & ( 1 << ( x % 8 ) ) ) { + return true; + } + + x = XKeysymToKeycode( GDK_DISPLAY(), XK_Meta_R ); + if ( keys[x / 8] & ( 1 << ( x % 8 ) ) ) { + return true; + } + return false; #endif }