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

4

2 回答 2

7

好的。终于明白了。非常感谢 David、Matthias 和 Enrico。以下是步骤:

  • 导入私有框架 GraphicsServices
  • 在 viewDidLoad 中调用 GSEventSetHardwareKeyboardAttached(NO)
  • 添加一个通过调用来切换键盘的按钮

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

我在http://code.google.com/p/btstack/wiki/iPhoneKeyboardHiding上找到了这个功能 现在我可以同时从软键盘和蓝牙设​​备输入。

于 2010-11-14T16:44:49.687 回答
0

要使用苹果键盘绕过它,请按弹出键。也许您可以实现发送弹出键码的操作?我认为 iSSH 有一个功能,即使连接了蓝牙键盘,您也可以点击屏幕上的键盘图标将其调出。

于 2010-11-11T07:38:46.127 回答