diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:37 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:37 +0000 |
commit | 643a294e68e1281e85c783ce53d0051ee2f31ea9 (patch) | |
tree | b154ba65b5d7ad36ccbbc175503c76222b6e5d4e /src/video/cocoa/cocoa_v.mm | |
parent | e4d48f3a3b67026825f54e2c8df18550f7220acf (diff) | |
download | openttd-643a294e68e1281e85c783ce53d0051ee2f31ea9.tar.xz |
(svn r25687) -Codechange: [OSX] Pass text input directly down to the text handling.
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 11ba8ab84..99f2c3fed 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -788,6 +788,23 @@ void cocoaReleaseAutoreleasePool() if (_cocoa_subdriver != NULL) UndrawMouseCursor(); _cursor.in_window = false; } + + +/** Insert the given text at the caret. */ +- (void)insertText:(id)aString +{ + NSString *s = [ aString isKindOfClass:[ NSAttributedString class ] ] ? [ aString string ] : (NSString *)aString; + + HandleTextInput(NULL, true); + HandleTextInput([ s UTF8String ]); +} + +/** Invoke the selector if we implement it. */ +- (void)doCommandBySelector:(SEL)aSelector +{ + if ([ self respondsToSelector:aSelector ]) [ self performSelector:aSelector ]; +} + @end |