comparison src/video/cocoa/SDL_cocoakeyboard.m @ 2289:f629d566ec6b

Merged fix for bug #508 from SDL 1.2 revision 3495
author Sam Lantinga <slouken@libsdl.org>
date Sat, 29 Dec 2007 21:36:17 +0000
parents a25bc0f79557
children d87417504c75
comparison
equal deleted inserted replaced
2288:e9bcf004c324 2289:f629d566ec6b
51 #define NX_DEVICERALTKEYMASK 0x00000040 51 #define NX_DEVICERALTKEYMASK 0x00000040
52 #endif 52 #endif
53 #ifndef NX_DEVICERCTLKEYMASK 53 #ifndef NX_DEVICERCTLKEYMASK
54 #define NX_DEVICERCTLKEYMASK 0x00002000 54 #define NX_DEVICERCTLKEYMASK 0x00002000
55 #endif 55 #endif
56
57 @interface SDLTranslatorResponder : NSTextView
58 {
59 }
60 - (void) doCommandBySelector:(SEL)myselector;
61 @end
62
63 @implementation SDLTranslatorResponder
64 - (void) doCommandBySelector:(SEL) myselector {}
65 @end
56 66
57 /* This is the original behavior, before support was added for 67 /* This is the original behavior, before support was added for
58 * differentiating between left and right versions of the keys. 68 * differentiating between left and right versions of the keys.
59 */ 69 */
60 static void 70 static void
328 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; 338 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
329 SDL_Keyboard keyboard; 339 SDL_Keyboard keyboard;
330 NSAutoreleasePool *pool; 340 NSAutoreleasePool *pool;
331 341
332 pool = [[NSAutoreleasePool alloc] init]; 342 pool = [[NSAutoreleasePool alloc] init];
333 data->fieldEdit = [[NSTextView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 0.0, 0.0)]; 343 data->fieldEdit = [[SDLTranslatorResponder alloc] initWithFrame:NSMakeRect(0.0, 0.0, 0.0, 0.0)];
334 [pool release]; 344 [pool release];
335 345
336 SDL_zero(keyboard); 346 SDL_zero(keyboard);
337 data->keyboard = SDL_AddKeyboard(&keyboard, -1); 347 data->keyboard = SDL_AddKeyboard(&keyboard, -1);
338 348