问题描述
我正在使用RN-42-HID蓝牙模块为iOS创建一个非常简单的Arduino BT键盘.我已经能够连接到iPad并向其发送一些HID报告.
I'm creating a very simple Arduino BT keyboard for iOS using a RN-42-HID Bluetooth module. I've been able to connect to an iPad and send it a few HID reports.
到目前为止,我可以使光标向左,向右,向上和向下移动,以及选择某个应用程序.耶!我使用Roving Network的HID手册中详细介绍的HID原始报告来完成此操作.
So far, I can make the cursor go left, right, up and down, as well as select a certain app. Yay! I do this using the HID raw reports as detailed by Roving Network's HID manual.
我一直在尝试找出如何使iPad进入主屏幕或更改页面.当我与启用了VoiceOver的常规BT键盘连接时,"ctrl + alt + H"的BT键盘组合使iPad返回主页.
I've been trying to figure out how to make my iPad go to the home screen, or change the page. When I connect with a regular BT keyboard, with VoiceOver enabled, the BT keyboard combination of "ctrl + alt + H" makes the iPad return to the home page.
当我发送相应的HID原始报告时,iPad不会返回家中.
When I send the corresponding HID raw report, the iPad doesn't return home.
const byte HOME1[] = { //equivalent to keyboard ctrl + opt/alt + h
0xFD,0x09,0x01,0x05,0x00,0x0B,0x00,0x00,0x00,0x00,0x00};
打开文本字段时,它会看到"H"并打印"H",但它不会返回首页.
It sees the "H", and prints "H" when I have a text field open, but it just doesn't return to the home page.
我也尝试过同时发送修饰键,作为3个扫描码的组合,但这在iPad上也不起作用.
I've also tried sending the modifier keys just as a combination of 3 scan codes at the same time, but that didn't work on the iPad, either.
const byte HOME2[] = { //equivalent to keyboard ctrl + opt/alt + h
0xFD,0x09,0x01,0x00,0x00,0xE0,0xE2,0x0B,0x00,0x00,0x00};
我以正确的格式发送报告吗?我发送正确的扫描代码吗?
Am I sending the report in the right format? Am I sending the right scan codes?
即使您没有实际的扫描代码,也可以通过某种方法找出激活首页的代码.有谁知道我如何找到主页"按钮(以及翻页,还涉及"alt"按钮)的扫描代码?
Even if you don't have the actual scan code, it would be nice if there was a way to figure out what code activates the home page. Does anyone know how I can find the scan code for the home button (and for page turn, which also involves the alt button)?
推荐答案
我遇到了类似的问题,但是按键组合不同.我发现我必须将动作分为3个步骤:Ctrl + alt +字母",然后Ctrl + alt,然后释放所有按钮.因此,仅查看您的代码,也许尝试发送以下序列:
I had a similar issue but with a different combination of keys. I found that i had to split the action into 3 steps: Ctrl+alt+ "letter", then Ctrl+alt, then all buttons released. So just looking at your code, maybe try sending this sequence:
0xFD,0x09,0x01, 0x05 ,0x00, 0x0B ,0x00,0x00,0x00,0x00,0x00//ctrl + alt + h
0xFD,0x09,0x01,0x05,0x00,0x0B,0x00,0x00,0x00,0x00,0x00 //ctrl + alt + h
0xFD,0x09,0x01, 0x05 ,0x00, 0x00 ,0x00,0x00,0x00,0x00,0x00//ctrl + alt
0xFD,0x09,0x01,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00 //ctrl + alt
0xFD,0x09,0x01, 0x00 ,0x00, 0x00 ,0x00,0x00,0x00,0x00,0x00//全部释放.
0xFD,0x09,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 //all released.
这篇关于HID报告/iPhone/iPad主页按钮的扫描代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!