1.1 --- a/src/video/cocoa/SDL_cocoawindow.m Sun Jul 30 06:11:52 2006 +0000
1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m Sun Jul 30 08:09:20 2006 +0000
1.3 @@ -127,12 +127,18 @@
1.4
1.5 - (void)windowDidBecomeKey:(NSNotification *)aNotification
1.6 {
1.7 - SDL_SendWindowEvent(_data->windowID, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
1.8 + int index;
1.9 +
1.10 + index = _data->videodata->keyboard;
1.11 + SDL_SetKeyboardFocus(index, _data->windowID);
1.12 }
1.13
1.14 - (void)windowDidResignKey:(NSNotification *)aNotification
1.15 {
1.16 - SDL_SendWindowEvent(_data->windowID, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
1.17 + int index;
1.18 +
1.19 + index = _data->videodata->keyboard;
1.20 + SDL_SetKeyboardFocus(index, 0);
1.21 }
1.22
1.23 - (void)windowDidHide:(NSNotification *)aNotification
1.24 @@ -254,26 +260,6 @@
1.25 SDL_SendMouseWheel(index, (int)([theEvent deltaY]+0.9f));
1.26 }
1.27
1.28 -- (void)keyDown:(NSEvent *)theEvent
1.29 -{
1.30 - int index;
1.31 -
1.32 - index = _data->videodata->keyboard;
1.33 -fprintf(stderr, "keyDown\n");
1.34 - const char *text = [[theEvent characters] UTF8String];
1.35 - if(text && *text) {
1.36 - SDL_SendKeyboardText(index, text);
1.37 - }
1.38 -}
1.39 -
1.40 -- (void)keyUp:(NSEvent *)theEvent
1.41 -{
1.42 - int index;
1.43 -
1.44 - index = _data->videodata->keyboard;
1.45 -fprintf(stderr, "keyUp\n");
1.46 -}
1.47 -
1.48 @end
1.49
1.50 static int