Be more flexible about hotkey modifier permutations.

Open .ini files with TextEdit on OS X since wx has no binding.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6986 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-30 14:20:20 +00:00
parent f41e5b3b85
commit 2622f86eb6
7 changed files with 72 additions and 53 deletions

View File

@ -259,11 +259,6 @@ void X11_MainLoop()
int main(int argc, char* argv[])
{
#ifdef __APPLE__
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSEvent *event = [[NSEvent alloc] init];
ProcessSerialNumber psn;
#endif
int ch, help = 0;
struct option longopts[] = {
{ "exec", no_argument, NULL, 'e' },
@ -307,36 +302,32 @@ int main(int argc, char* argv[])
if (BootManager::BootCore(argv[optind]))
{
#ifdef __APPLE__
GetCurrentProcess(&psn);
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
SetFrontProcess(&psn);
if (NSApp == nil) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSEvent *event = [[NSEvent alloc] init];
[NSApplication sharedApplication];
//TODO : Create menu
[NSApp activateIgnoringOtherApps: YES];
[NSApp finishLaunching];
}
while (running)
{
event = [NSApp nextEventMatchingMask: NSAnyEventMask
untilDate: [NSDate distantFuture]
inMode: NSDefaultRunLoopMode dequeue: YES];
if ([event type] == NSKeyDown &&
[event modifierFlags] & NSCommandKeyMask &&
[[event characters] UTF8String][0] == 'q')
while (running)
{
Core::Stop();
break;
}
event = [NSApp nextEventMatchingMask: NSAnyEventMask
untilDate: [NSDate distantFuture]
inMode: NSDefaultRunLoopMode dequeue: YES];
if ([event type] == NSKeyDown &&
[event modifierFlags] & NSCommandKeyMask &&
[[event characters] UTF8String][0] == 'q')
{
Core::Stop();
break;
}
if ([event type] != NSKeyDown)
[NSApp sendEvent: event];
}
if ([event type] != NSKeyDown)
[NSApp sendEvent: event];
}
[event release];
[pool release];
[event release];
[pool release];
#elif defined HAVE_X11 && HAVE_X11
XInitThreads();
X11_MainLoop();