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.

This commit is contained in:
jdolan 2013-09-12 12:16:43 -04:00
parent 16625f0e7f
commit e3d0f74cdc

View file

@ -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
}