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

Community
  • 1
  • 1
marcio
  • 2,729
  • 2
  • 25
  • 23

2 Answers2

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.

marcio
  • 2,729
  • 2
  • 25
  • 23
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.

CodeWombat
  • 778
  • 2
  • 7
  • 26