diff --git a/global.h b/global.h index d4ed4517..bdcf7acb 100644 --- a/global.h +++ b/global.h @@ -1,5 +1,7 @@ /* Grafx2 - The Ultimate 256-color bitmap paint program + Copyright 2009 Franck Charlet + Copyright 2009 Yves Rizoud Copyright 2007 Adrien Destugues Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) @@ -103,21 +105,14 @@ GFX2_GLOBAL dword Key_ANSI; #undef MOD_ALT #endif -#if defined(__macosx__) -#ifdef MOD_META - #undef MOD_META -#endif -#endif - /// Key modifier for SHIFT key. Used as mask in ::Key, for example. #define MOD_SHIFT 0x1000 /// Key modifier for CONTROL key. Used as mask in ::Key, for example. #define MOD_CTRL 0x2000 /// Key modifier for ALT key. Used as mask in ::Key, for example. #define MOD_ALT 0x4000 -#if defined(__macosx__) +/// Key modifier for META key. Used as mask in ::Key, for example. #define MOD_META 0x8000 -#endif /// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button GFX2_GLOBAL byte Quit_is_required; diff --git a/input.c b/input.c index 9335cb42..38152237 100644 --- a/input.c +++ b/input.c @@ -356,22 +356,22 @@ int Handle_key_release(SDL_KeyboardEvent event) case SDLK_LSHIFT: modifier=MOD_SHIFT; break; + case SDLK_RCTRL: case SDLK_LCTRL: modifier=MOD_CTRL; break; + case SDLK_RALT: case SDLK_LALT: case SDLK_MODE: modifier=MOD_ALT; break; -#if defined(__macosx__) case SDLK_RMETA: case SDLK_LMETA: modifier=MOD_META; break; -#endif default: modifier=0; diff --git a/keyboard.c b/keyboard.c index 20d371fd..e311d81a 100644 --- a/keyboard.c +++ b/keyboard.c @@ -318,11 +318,8 @@ word Key_modifiers(SDLMod mod) modifiers|=MOD_SHIFT; if (mod & (KMOD_ALT|KMOD_MODE)) modifiers|=MOD_ALT; - -#if defined(__macosx__) if (mod & (KMOD_META)) modifiers|=MOD_META; -#endif return modifiers; } @@ -457,6 +454,12 @@ const char * Key_name(word Key) strcat(buffer, "Alt+"); if (Key & MOD_SHIFT) strcat(buffer, "Shift+"); + if (Key & MOD_META) + strcat(buffer, "\201"); + // Note: Apple's "command" character is not present in the ANSI table, so we + // recycled an ANSI value that doesn't have any displayable character + // associated. + Key=Key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT); @@ -495,12 +498,12 @@ const char * Key_name(word Key) return buffer; } - if (Key & 0x8000) + if (Key & 0x800) { - sprintf(buffer+strlen(buffer), "[%d]", Key & 0xFFF); + sprintf(buffer+strlen(buffer), "[%d]", Key & 0x7FF); return buffer; } - Key = Key & 0xFFF; + Key = Key & 0x7FF; // Touches ASCII if (Key>=' ' && Key < 127) { diff --git a/skins/base.gif b/skins/base.gif index 24e5194f..bf95a3e7 100644 Binary files a/skins/base.gif and b/skins/base.gif differ