- Issue #160 should be fixed now.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@804 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Franck Charlet 2009-05-14 13:49:36 +00:00
parent 315a17ae5b
commit 2feab9d52c
9 changed files with 85 additions and 21 deletions

Binary file not shown.

View File

@ -16,6 +16,11 @@
F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */; }; F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */; };
F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; }; F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; };
F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; }; F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; };
F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405A0FBC406D00B7577C /* pxquad.c */; };
F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405B0FBC406D00B7577C /* pxtall2.c */; };
F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405C0FBC406D00B7577C /* pxtriple.c */; };
F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405D0FBC406D00B7577C /* pxwide2.c */; };
F5AA40630FBC406D00B7577C /* transform.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405E0FBC406D00B7577C /* transform.c */; };
F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28B90F4873C700455509 /* hotkeys.c */; }; F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28B90F4873C700455509 /* hotkeys.c */; };
F5AC28BD0F4873C700455509 /* input.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BA0F4873C700455509 /* input.c */; }; F5AC28BD0F4873C700455509 /* input.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BA0F4873C700455509 /* input.c */; };
F5AC28BE0F4873C700455509 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BB0F4873C700455509 /* realpath.c */; }; F5AC28BE0F4873C700455509 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BB0F4873C700455509 /* realpath.c */; };
@ -143,6 +148,11 @@
F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */ = {isa = PBXFileReference; lastKnownFileType = file; name = colorfont.pcx; path = fonts/colorfont.pcx; sourceTree = "<group>"; }; F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */ = {isa = PBXFileReference; lastKnownFileType = file; name = colorfont.pcx; path = fonts/colorfont.pcx; sourceTree = "<group>"; };
F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = "<group>"; }; F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = "<group>"; };
F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = "<group>"; }; F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = "<group>"; };
F5AA405A0FBC406D00B7577C /* pxquad.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxquad.c; sourceTree = "<group>"; };
F5AA405B0FBC406D00B7577C /* pxtall2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall2.c; sourceTree = "<group>"; };
F5AA405C0FBC406D00B7577C /* pxtriple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtriple.c; sourceTree = "<group>"; };
F5AA405D0FBC406D00B7577C /* pxwide2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide2.c; sourceTree = "<group>"; };
F5AA405E0FBC406D00B7577C /* transform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = transform.c; sourceTree = "<group>"; };
F5AC28B90F4873C700455509 /* hotkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hotkeys.c; sourceTree = "<group>"; }; F5AC28B90F4873C700455509 /* hotkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hotkeys.c; sourceTree = "<group>"; };
F5AC28BA0F4873C700455509 /* input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = "<group>"; }; F5AC28BA0F4873C700455509 /* input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = "<group>"; };
F5AC28BB0F4873C700455509 /* realpath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = "<group>"; }; F5AC28BB0F4873C700455509 /* realpath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = "<group>"; };
@ -313,6 +323,11 @@
children = ( children = (
32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */, 32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */,
002F3A3E09D088BA00EBEB88 /* main.c */, 002F3A3E09D088BA00EBEB88 /* main.c */,
F5AA405A0FBC406D00B7577C /* pxquad.c */,
F5AA405B0FBC406D00B7577C /* pxtall2.c */,
F5AA405C0FBC406D00B7577C /* pxtriple.c */,
F5AA405D0FBC406D00B7577C /* pxwide2.c */,
F5AA405E0FBC406D00B7577C /* transform.c */,
); );
name = "Other Sources"; name = "Other Sources";
sourceTree = "<group>"; sourceTree = "<group>";
@ -429,6 +444,11 @@
F5B310B80F949A9C008197E2 /* keyboard.c in Sources */, F5B310B80F949A9C008197E2 /* keyboard.c in Sources */,
F5B310B90F949A9C008197E2 /* misc.c in Sources */, F5B310B90F949A9C008197E2 /* misc.c in Sources */,
F5B310BA0F949A9C008197E2 /* text.c in Sources */, F5B310BA0F949A9C008197E2 /* text.c in Sources */,
F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */,
F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */,
F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */,
F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */,
F5AA40630FBC406D00B7577C /* transform.c in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -165,8 +165,8 @@
PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Warnings_ColumnID,
); );
}; };
PBXPerProjectTemplateStateSaveDate = 262786429; PBXPerProjectTemplateStateSaveDate = 263995769;
PBXWorkspaceStateSaveDate = 262786429; PBXWorkspaceStateSaveDate = 263995769;
}; };
sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */; sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */;
userBuildSettings = { userBuildSettings = {

View File

@ -456,7 +456,7 @@
<dict> <dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array> <array>
<real>418</real> <real>275</real>
</array> </array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array> <array>
@ -481,7 +481,7 @@
</array> </array>
</array> </array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 506}, {418, 592}}</string> <string>{{0, 0}, {275, 583}}</string>
</dict> </dict>
<key>PBXTopSmartGroupGIDs</key> <key>PBXTopSmartGroupGIDs</key>
<array/> <array/>
@ -491,19 +491,19 @@
<key>GeometryConfiguration</key> <key>GeometryConfiguration</key>
<dict> <dict>
<key>Frame</key> <key>Frame</key>
<string>{{0, 0}, {435, 610}}</string> <string>{{0, 0}, {292, 601}}</string>
<key>GroupTreeTableConfiguration</key> <key>GroupTreeTableConfiguration</key>
<array> <array>
<string>MainColumn</string> <string>MainColumn</string>
<real>418</real> <real>275</real>
</array> </array>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>225 -383 1092 651 0 0 1024 746 </string> <string>2 -15 944 642 0 0 1024 746 </string>
</dict> </dict>
<key>Module</key> <key>Module</key>
<string>PBXSmartGroupTreeModule</string> <string>PBXSmartGroupTreeModule</string>
<key>Proportion</key> <key>Proportion</key>
<string>435pt</string> <string>292pt</string>
</dict> </dict>
<dict> <dict>
<key>Dock</key> <key>Dock</key>
@ -535,9 +535,9 @@
<key>GeometryConfiguration</key> <key>GeometryConfiguration</key>
<dict> <dict>
<key>Frame</key> <key>Frame</key>
<string>{{0, 0}, {652, 0}}</string> <string>{{0, 0}, {647, 0}}</string>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>225 -383 1092 651 0 0 1024 746 </string> <string>2 -15 944 642 0 0 1024 746 </string>
</dict> </dict>
<key>Module</key> <key>Module</key>
<string>PBXNavigatorGroup</string> <string>PBXNavigatorGroup</string>
@ -546,14 +546,14 @@
</dict> </dict>
<dict> <dict>
<key>Proportion</key> <key>Proportion</key>
<string>605pt</string> <string>596pt</string>
<key>Tabs</key> <key>Tabs</key>
<array> <array>
<dict> <dict>
<key>ContentConfiguration</key> <key>ContentConfiguration</key>
<dict> <dict>
<key>PBXBuildLogShowsTranscriptDefaultKey</key> <key>PBXBuildLogShowsTranscriptDefaultKey</key>
<string>{{0, 5}, {652, 573}}</string> <string>{{0, 5}, {647, 564}}</string>
<key>PBXProjectModuleGUID</key> <key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string> <string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key> <key>PBXProjectModuleLabel</key>
@ -566,9 +566,9 @@
<key>GeometryConfiguration</key> <key>GeometryConfiguration</key>
<dict> <dict>
<key>Frame</key> <key>Frame</key>
<string>{{10, 27}, {652, 578}}</string> <string>{{10, 27}, {647, 569}}</string>
<key>RubberWindowFrame</key> <key>RubberWindowFrame</key>
<string>225 -383 1092 651 0 0 1024 746 </string> <string>2 -15 944 642 0 0 1024 746 </string>
</dict> </dict>
<key>Module</key> <key>Module</key>
<string>PBXBuildResultsModule</string> <string>PBXBuildResultsModule</string>
@ -630,7 +630,7 @@
</dict> </dict>
</array> </array>
<key>Proportion</key> <key>Proportion</key>
<string>652pt</string> <string>647pt</string>
</dict> </dict>
</array> </array>
<key>Name</key> <key>Name</key>
@ -648,14 +648,14 @@
</array> </array>
<key>TableOfContents</key> <key>TableOfContents</key>
<array> <array>
<string>F5F7346C0F94B3DD003FC65B</string> <string>F5AA406F0FBC418100B7577C</string>
<string>1CA23EE50692099D00951B8B</string> <string>1CA23EE50692099D00951B8B</string>
<string>F5F7346D0F94B3DD003FC65B</string> <string>F5AA40700FBC418100B7577C</string>
<string>F5A33EC20EC89C3000F8052D</string> <string>F5A33EC20EC89C3000F8052D</string>
<string>F5F7346E0F94B3DD003FC65B</string> <string>F5AA40710FBC418100B7577C</string>
<string>XCMainBuildResultsModuleGUID</string> <string>XCMainBuildResultsModuleGUID</string>
<string>1CA23EE80692099D00951B8B</string> <string>1CA23EE80692099D00951B8B</string>
<string>F5F7346F0F94B3DD003FC65B</string> <string>F5AA40720FBC418100B7577C</string>
</array> </array>
<key>ToolbarConfiguration</key> <key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildAndRun</string> <string>xcode.toolbar.config.buildAndRun</string>
@ -829,7 +829,7 @@
<string>/Users/xx/Grafx2/Grafx2.xcodeproj</string> <string>/Users/xx/Grafx2/Grafx2.xcodeproj</string>
</array> </array>
<key>WindowString</key> <key>WindowString</key>
<string>225 -383 1092 651 0 0 1024 746 </string> <string>2 -15 944 642 0 0 1024 746 </string>
<key>WindowTools</key> <key>WindowTools</key>
<array> <array>
<dict> <dict>

View File

@ -76,6 +76,20 @@ static NSString *getApplicationName(void)
event.type = SDL_QUIT; event.type = SDL_QUIT;
SDL_PushEvent(&event); SDL_PushEvent(&event);
} }
/* override NSApplication:sendEvent, to keep Cocoa from beeping on
non-command keystrokes */
- (void)sendEvent:(NSEvent *)anEvent {
if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) {
if ([anEvent modifierFlags] & NSCommandKeyMask)
{
SDL_SetModState(SDL_GetModState() | KMOD_META);
[super sendEvent: anEvent];
}
} else
{
[super sendEvent: anEvent];
}
}
@end @end
/* The main class of the application, the application's delegate */ /* The main class of the application, the application's delegate */
@ -297,6 +311,8 @@ static void CustomApplicationMain (int argc, char **argv)
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif #endif
setenv("SDL_ENABLEAPPEVENTS", "1", 1);
/* Hand off to main application code */ /* Hand off to main application code */
gCalledAppMainline = TRUE; gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv); status = SDL_main (gArgc, gArgv);

View File

@ -1,5 +1,6 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program /* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2009 Franck Charlet
Copyright 2008 Peter Gordon Copyright 2008 Peter Gordon
Copyright 2008 Yves Rizoud Copyright 2008 Yves Rizoud
Copyright 2007 Adrien Destugues Copyright 2007 Adrien Destugues

View File

@ -102,12 +102,22 @@ GFX2_GLOBAL dword Key_ANSI;
#ifdef MOD_ALT #ifdef MOD_ALT
#undef MOD_ALT #undef MOD_ALT
#endif #endif
#if defined(__macosx__)
#ifdef MOD_META
#undef MOD_META
#endif
#endif
/// Key modifier for SHIFT key. Used as mask in ::Key, for example. /// Key modifier for SHIFT key. Used as mask in ::Key, for example.
#define MOD_SHIFT 0x1000 #define MOD_SHIFT 0x1000
/// Key modifier for CONTROL key. Used as mask in ::Key, for example. /// Key modifier for CONTROL key. Used as mask in ::Key, for example.
#define MOD_CTRL 0x2000 #define MOD_CTRL 0x2000
/// Key modifier for ALT key. Used as mask in ::Key, for example. /// Key modifier for ALT key. Used as mask in ::Key, for example.
#define MOD_ALT 0x4000 #define MOD_ALT 0x4000
#if defined(__macosx__)
#define MOD_META 0x8000
#endif
/// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button /// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button
GFX2_GLOBAL byte Quit_is_required; GFX2_GLOBAL byte Quit_is_required;

View File

@ -1,5 +1,6 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program /* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2009 Franck Charlet
Copyright 2007 Adrien Destugues Copyright 2007 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
@ -364,6 +365,14 @@ int Handle_key_release(SDL_KeyboardEvent event)
case SDLK_MODE: case SDLK_MODE:
modifier=MOD_ALT; modifier=MOD_ALT;
break; break;
#if defined(__macosx__)
case SDLK_RMETA:
case SDLK_LMETA:
modifier=MOD_META;
break;
#endif
default: default:
modifier=0; modifier=0;
} }

View File

@ -1,5 +1,6 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program /* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2009 Franck Charlet
Copyright 2008 Yves Rizoud Copyright 2008 Yves Rizoud
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
@ -318,6 +319,11 @@ word Key_modifiers(SDLMod mod)
if (mod & (KMOD_ALT|KMOD_MODE)) if (mod & (KMOD_ALT|KMOD_MODE))
modifiers|=MOD_ALT; modifiers|=MOD_ALT;
#if defined(__macosx__)
if (mod & (KMOD_META))
modifiers|=MOD_META;
#endif
return modifiers; return modifiers;
} }
@ -325,11 +331,12 @@ word Keysym_to_keycode(SDL_keysym keysym)
{ {
word key_code = 0; word key_code = 0;
word mod; word mod;
// On ignore shift, alt et control isolés. // On ignore shift, alt et control isolés.
if (keysym.sym == SDLK_RSHIFT || keysym.sym == SDLK_LSHIFT || if (keysym.sym == SDLK_RSHIFT || keysym.sym == SDLK_LSHIFT ||
keysym.sym == SDLK_RCTRL || keysym.sym == SDLK_LCTRL || keysym.sym == SDLK_RCTRL || keysym.sym == SDLK_LCTRL ||
keysym.sym == SDLK_RALT || keysym.sym == SDLK_LALT || keysym.sym == SDLK_RALT || keysym.sym == SDLK_LALT ||
keysym.sym == SDLK_RMETA || keysym.sym == SDLK_LMETA ||
keysym.sym == SDLK_MODE) // AltGr keysym.sym == SDLK_MODE) // AltGr
return 0; return 0;
@ -346,6 +353,7 @@ word Keysym_to_keycode(SDL_keysym keysym)
// is buggy: if you release a modifier key, the following keys (when they repeat) // is buggy: if you release a modifier key, the following keys (when they repeat)
// still name the original modifiers. // still name the original modifiers.
mod=Key_modifiers(SDL_GetModState()); mod=Key_modifiers(SDL_GetModState());
// SDL_GetModState() seems to get the right up-to-date info. // SDL_GetModState() seems to get the right up-to-date info.
key_code |= mod; key_code |= mod;
return key_code; return key_code;