Added key composition support, courtesy of Kuon
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402485
This commit is contained in:
parent
ffec21f2e4
commit
f7ff123cf8
2 changed files with 6 additions and 0 deletions
|
@ -514,6 +514,8 @@ Cocoa_InitKeyboard(_THIS)
|
|||
|
||||
InitKeymap(data->keymap);
|
||||
|
||||
data->fieldEdit = [[NSTextView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 0.0, 0.0)];
|
||||
|
||||
SDL_zero(keyboard);
|
||||
data->keyboard = SDL_AddKeyboard(&keyboard, -1);
|
||||
}
|
||||
|
@ -537,6 +539,7 @@ Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
|
|||
data->keymap[scancode]);
|
||||
}
|
||||
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
|
||||
[data->fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
text = [[event characters] UTF8String];
|
||||
if(text && *text) {
|
||||
SDL_SendKeyboardText(data->keyboard, text);
|
||||
|
@ -559,6 +562,8 @@ Cocoa_QuitKeyboard(_THIS)
|
|||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||
|
||||
SDL_DelKeyboard(data->keyboard);
|
||||
|
||||
[data->fieldEdit release];
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -46,6 +46,7 @@ typedef struct SDL_VideoData
|
|||
unsigned int modifierFlags;
|
||||
int mouse;
|
||||
int keyboard;
|
||||
NSText *fieldEdit;
|
||||
} SDL_VideoData;
|
||||
|
||||
#endif /* _SDL_cocoavideo_h */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue