diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-10-13 23:17:19 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-10-13 23:17:39 +0300 |
commit | 12b1ca3236aa167c007c6c87e0d2f2d06c495821 (patch) | |
tree | 71471cdb910c3d0990c4c9bac4c97396e7d472a5 /ios | |
parent | cbae2baa412437b624a1f01671ec16d9fdc358bb (diff) |
Hacking on iOS keyboard handling
Change-Id: I0d842cc951cb5a3e7e990f835f541ccf1bd89df6
Diffstat (limited to 'ios')
-rw-r--r-- | ios/experimental/LibreOffice/LibreOffice/AppDelegate.m | 21 | ||||
-rw-r--r-- | ios/experimental/LibreOffice/LibreOffice/View.m | 2 |
2 files changed, 21 insertions, 2 deletions
diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m index dddf3acd458b..c3ed9ebb7832 100644 --- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m +++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m @@ -16,6 +16,7 @@ #import "lo.h" static View *theView; +static BOOL keyboardShows; @implementation AppDelegate @@ -78,6 +79,8 @@ static View *theView; NSThread* thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:nil]; + keyboardShows = NO; + [thread start]; return YES; @@ -158,6 +161,8 @@ static View *theView; NSLog(@"keyboardWillShow: frame:%dx%d@(%d,%d)", (int) frameEnd.size.width, (int) frameEnd.size.height, (int) frameEnd.origin.x, (int) frameEnd.origin.y); + + keyboardShows = YES; } - (void)keyboardDidHide:(NSNotification *)note @@ -166,6 +171,8 @@ static View *theView; NSLog(@"keyboardDidHide"); + keyboardShows = NO; + touch_lo_keyboard_did_hide(); } @@ -186,6 +193,15 @@ void touch_ui_damaged(int minX, int minY, int width, int height) void touch_ui_show_keyboard() { +#if 0 + // Horrible hack + static bool beenHere = false; + if (!beenHere) { + beenHere = true; + touch_lo_keyboard_did_hide(); + return; + } +#endif dispatch_async(dispatch_get_main_queue(), ^{ [theView->textView becomeFirstResponder]; }); @@ -198,4 +214,9 @@ void touch_ui_hide_keyboard() }); } +bool touch_ui_keyboard_visible() +{ + return keyboardShows; +} + // vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m index 3cd332b1f514..de7b31144ac3 100644 --- a/ios/experimental/LibreOffice/LibreOffice/View.m +++ b/ios/experimental/LibreOffice/LibreOffice/View.m @@ -54,8 +54,6 @@ // NSLog(@"tapGesture: at: (%d,%d)", (int)location.x, (int)location.y); touch_lo_tap(location.x, location.y); - - [self->textView becomeFirstResponder]; } else { // NSLog(@"tapGesture: %@", gestureRecognizer); } |