连接蓝牙输入设备时显示软键盘(iPad)

发布于 2024-10-01 12:08:06 字数 782 浏览 0 评论 0原文

我真的很头疼,因为当有蓝牙输入设备连接到 iPad 时,我找不到显示软键盘的方法。我在网上做了一些搜索,结果如下:

Erica 说,诀窍是回答系统“没有连接硬件键盘”。 我尝试为 UIKeyboardImpl 编写一个类别,并覆盖:

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

但到目前为止我还没有获得任何东西。调用了重写的方法,但没有软键盘。 埃里卡还说该应用程序通过动态链接工作,但我不知道如何实现它。我不需要进入 AppStore,因为这是一个私人应用程序,所以我不用担心被拒绝。

提前致谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清浅ˋ旧时光 2024-10-08 12:08:06

好的。终于明白了。非常感谢大卫、马蒂亚斯和恩里科。步骤如下:

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

    静态无效toggleKeyboard(UIKeyboardImpl * keyImpl){
    如果(UIKeyboardAutomaticIsOnScreen()){
        UIKeyboardOrderOutAutomatic();
    } 别的 {
        UIKeyboardOrderInAutomatic();
    }
    

添加一个按钮,通过调用I've find this function on http://code.google.com/p/btstack/wiki/iPhoneKeyboardHiding
现在我可以同时从软键盘和蓝牙设​​备获取输入。

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.

扬花落满肩 2024-10-08 12:08:06

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文