display soft keyboard (iPad) when is connected a bluetooth input device
Asked Answered
A

2

3

I'm really bangin' my head because I can't find the way to show the soft keyboard when there's a bluetooth input device connected to the iPad. I made some search on the web and this is the result:

Erica said that the trick is to answer to the system that "There's no hardware keyboard attached". I tried to write a category for UIKeyboardImpl and I overrided:

- (BOOL)isInHardwareKeyboardMode {
    DEBUG(@"is called");
    return NO;
}   

But until now I haven't obtained anything. The overrided method is called but there's no soft keyboard. Erica also said the application works by dynamic linking but I don't know how can I accomplish it. I don't need to be in the AppStore because this is a private application so I don't bother about rejection.

Thanks in advance

Aniela answered 11/11, 2010 at 1:36 Comment(0)
A
7

Ok. Finally got it. Many thanks to David, Matthias and Enrico. Here are the steps:

  • import the private framework GraphicsServices
  • call GSEventSetHardwareKeyboardAttached(NO) inside the viewDidLoad
  • add a button that toggles the keyboard by calling

    static void toggleKeyboard(UIKeyboardImpl * keyImpl){
    if (UIKeyboardAutomaticIsOnScreen()) {
        UIKeyboardOrderOutAutomatic();
    } else {
        UIKeyboardOrderInAutomatic();
    }
    

I've found this function on http://code.google.com/p/btstack/wiki/iPhoneKeyboardHiding Now I can take input from the soft keyboard and from the bluetooth device at the same time.

Aniela answered 14/11, 2010 at 16:44 Comment(4)
doesn't using a private framework mean you will get rejected from the iTunes store?Dissect
he said it's a private-use app so he doesn't care.Breezeway
Never saw rejects on private API.Plump
What about for iOS 10 ? any help ?Ursuline
P
0

To get around it using the apple keyboard you hit the eject key. Perhaps you can implement an action that sends the eject keycode? I think iSSH has a feature where you can tap the onscreen keyboard icon to bring it up even when a bluetooth keyboard is connected.

Principled answered 11/11, 2010 at 7:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.