summaryrefslogtreecommitdiff
path: root/src/video/cocoa/event.mm
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2014-08-24 10:34:43 +0000
committermichi_cc <michi_cc@openttd.org>2014-08-24 10:34:43 +0000
commit2b3b8c93e7b39154c130f5fc98a6f7ce24ea4cf7 (patch)
treee29c1eb806b4ada9c5efc4034b46f5ebeb5a2b0d /src/video/cocoa/event.mm
parent9c5530762990939dd3b71a69ed8644b06cb3b61b (diff)
downloadopenttd-2b3b8c93e7b39154c130f5fc98a6f7ce24ea4cf7.tar.xz
(svn r26758) -Fix [FS#5972]: [OSX] Implement more of the text editing API to prevent crashes and improve IME support.
Diffstat (limited to 'src/video/cocoa/event.mm')
-rw-r--r--src/video/cocoa/event.mm13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index 78785f8d0..39e6cc445 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -290,6 +290,17 @@ static bool QZ_KeyEvent(unsigned short keycode, unsigned short unicode, BOOL dow
VideoDriver::GetInstance()->ToggleFullscreen(!_fullscreen);
}
break;
+
+ case QZ_v:
+ if (down && EditBoxInGlobalFocus() && (_current_mods & (NSCommandKeyMask | NSControlKeyMask))) {
+ HandleKeypress(WKC_CTRL | 'V', unicode);
+ }
+ break;
+ case QZ_u:
+ if (down && EditBoxInGlobalFocus() && (_current_mods & (NSCommandKeyMask | NSControlKeyMask))) {
+ HandleKeypress(WKC_CTRL | 'U', unicode);
+ }
+ break;
}
if (down) {
@@ -310,7 +321,7 @@ static bool QZ_KeyEvent(unsigned short keycode, unsigned short unicode, BOOL dow
console = false;
/* Don't handle normal characters if an edit box has the focus. */
- if (!EditBoxInGlobalFocus() || ((pressed_key & ~WKC_SPECIAL_KEYS) <= WKC_TAB) || IsInsideMM(pressed_key & ~WKC_SPECIAL_KEYS, WKC_F1, WKC_PAUSE + 1)) {
+ if (!EditBoxInGlobalFocus() || IsInsideMM(pressed_key & ~WKC_SPECIAL_KEYS, WKC_F1, WKC_PAUSE + 1)) {
HandleKeypress(pressed_key, unicode);
}
DEBUG(driver, 2, "cocoa_v: QZ_KeyEvent: %x (%x), down, mapping: %x", keycode, unicode, pressed_key);