From abdcd471f925c1f9c181ab0de1907db460449321 Mon Sep 17 00:00:00 2001 From: Dong Yuwei Date: Sat, 20 May 2017 08:44:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E9=94=AE=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=E8=87=AA=E5=8A=A8=E9=99=84=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=EF=BC=9Benter=E5=9B=9E=E8=BD=A6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E9=80=89=E6=8B=A9=E6=97=B6=E4=B8=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=99=84=E5=8A=A0=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/InputController.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/InputController.m b/src/InputController.m index bb6881c..a8745cb 100644 --- a/src/InputController.m +++ b/src/InputController.m @@ -89,14 +89,23 @@ -(BOOL)onKeyEvent:(NSEvent*)event client:(id)sender{ return NO; } - if(keyCode == KEY_RETURN || keyCode == KEY_SPACE){ + if(keyCode == KEY_RETURN){ if ( bufferedText && [bufferedText length] > 0 ) { [self commitComposition:sender]; return YES; } return NO; } - + + if(keyCode == KEY_SPACE){ + if ( bufferedText && [bufferedText length] > 0 ) { + [self appendToComposedBuffer: @" "]; + [self commitComposition:sender]; + return YES; + } + return NO; + } + if(keyCode == KEY_ESC){ if ( bufferedText && [bufferedText length] > 0 ) { [self cancelComposition];