Start work of OSX keyboard input, doesn't work, so it's currently disabled, but it's a beginning. Also changed variable 'id' to 'cid' because id is a object type in Obj-C, which I was running in to problems with, kept it that way just in case.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5269 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1
2010-04-02 09:41:43 +00:00
parent 2742be1c2e
commit 48533bb3db
7 changed files with 236 additions and 10 deletions

View File

@ -0,0 +1,38 @@
#import <AppKit/NSWindow.h>
#import <AppKit/NSView.h>
#import <Cocoa/Cocoa.h>
#include "OSXPrivate.h"
NSWindow* m_Window;
void OSX_Init(void *_View)
{
// _View is really a wxNSView
//m_Window is really a wxNSWindow
NSView *View = (NSView*)_View;
m_Window = [View window];
}
void OSX_UpdateKeys( int max, char* keys )
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSEvent *event = [[NSEvent alloc] init];
/*event = [m_Window nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
if ( event != nil ) {
switch ([event type]) {
case NSKeyDown:
//case NSKeyUp:
//case NSFlagsChanged: // For Command
memcpy(keys, [[event characters] UTF8String], max);
break;
default:
[m_Window sendEvent:event];
break;
}
}*/
[event release];
[pool release];
}