【问题标题】:Toggle virtual keyboard with Bluetooth HID使用蓝牙 HID 切换虚拟键盘
【发布时间】:2020-07-25 18:00:03
【问题描述】:

我正在 NRF52810 上开发 HID 设备。 在IOS上测试HID的工作后发现,连接HID设备时虚拟键盘消失,无法返回给iphone。

在阅读了 HID 的文档后,我没有找到正确的命令。

我找到了一个 BLE 键盘,它有这个键来启用虚拟键盘。测试键盘后,我发现了以下内容: 1) 在 Windows 上,此按钮启动上下文菜单,键码 0x65 2) 在 android 上,此按钮启动上下文菜单 3) 在ios上,隐藏和打开虚拟键盘

我尝试通过我的设备发送此代码 (0x65)。正如预期的那样,在 windows 和 android 上打开了一个上下文菜单。但是,在 ios 上无法识别。键盘未出现,程序将键视为未定义。

有谁知道问题出在哪里?我需要向IOS发送什么代码才能打开虚拟键盘? HID描述符有问题吗?

    0x05, 0x01,       // Usage Page (Generic Desktop)
    0x09, 0x06,       // Usage (Keyboard)
    0xA1, 0x01,       // Collection (Application)
        0x85, 0x01,       // Report id(1)
        0x15, 0x00,       // Logical Minimum (0)
        0x25, 0x01,       // Logical Maximum (1)
        0x95, 0x05,       // Report Count (5)
        0x75, 0x01,       // Report Size (1)
        0x05, 0x08,       // Usage Page (Page# for LEDs)
        0x19, 0x01,       // Usage Minimum (1)
        0x29, 0x05,       // Usage Maximum (5)
        0x91, 0x02,       // Output (Data, Variable, Absolute), Led report
        0x95, 0x01,       // Report Count (1)
        0x75, 0x03,       // Report Size (3)
        0x91, 0x01,       // Output (Data, Variable, Absolute), Led report padding

        0x95, 0x04,       // Report Count (5)
        0x75, 0x08,       // Report Size (8)
        0x15, 0x00,       // Logical Minimum (0)
        0x25, 0xFF,       // Logical Maximum (255)
        0x05, 0x07,       // Usage Page (Key codes)
        0x19, 0x00,       // Usage Minimum (0)
        0x29, 0xFF,       // Usage Maximum (255)
        0x81, 0x00,       // Input (Data, Array) Key array(6 bytes)
    0xC0,              // End Collection (Application)

    0x05, 0x01,         // Usage Page (Desktop),
    0x09, 0x80,         // Usage (Generic Desktop),
    0xA1, 0x01,         // Collection (Application),
        0x85, 0x02,         // Report id(2)
        0x75, 0x01,         // Report Size (1)
        0x95, 0x08,         // Report Count (8)
        0x15, 0x00,         // Logical Minimum (0)
        0x25, 0x01,         // Logical Maximum (1)
        0x09, 0x81,         // Usage (System Power Down)
        0x09, 0x82,         // Usage (System Sleep)
        0x09, 0x83,         // Usage (System Wake Up)
        0x09, 0x84,         // Usage (System Context Menu)
        0x09, 0x85,         // Usage (System Main Menu)
        0x09, 0x86,         // Usage (System App Menu)
        0x09, 0x87,         // Usage (System Menu Help)
        0x09, 0x88,         // Usage (System Menu Exit)
        0x81, 0x02,         // Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)
    0xC0,               // End Collection,

【问题讨论】:

  • 谁能有类似的键盘?您可以尝试找出扫描密钥代码,以确保我提供的所有内容都正确。然后我就可以理解问题出在描述符中了

标签: ios bluetooth-lowenergy hid nrf52


【解决方案1】:

我意识到这是 9 个月前提出的问题,但我还是想添加答案,因为我也在尝试这样做并且最近想通了。我使用消费者控制使用页面管理它,具体用法:

0x0A, 0xAE, 0x01, // Usage (AL Keyboard Layout)

有关详细信息,请参阅HID Usage Tables 第 15.15 节。

【讨论】:

    猜你喜欢
    • 2011-12-17
    • 2017-05-09
    • 2011-11-04
    • 2012-10-14
    • 2021-11-11
    • 2022-01-08
    • 2010-09-21
    • 2014-01-05
    • 2020-05-06
    相关资源
    最近更新 更多