【发布时间】:2020-04-16 19:42:21
【问题描述】:
我有一个 Android JAVA 应用程序连接到我从这里购买的 USB 蓝牙键盘模拟器 http://intelletto.com/products
到目前为止,我可以发送 转义序列,例如 \t、\n,但我不确定如何发送 Key Down 事件的命令。以下是我的做法:
char str = '\t';
byte[] command = String.valueOf(str).getBytes();
mBTService.write(command);
另外,我从 USB 提供商那里得到了这个 HID ASCII 映射表,我不知道如何使用它。
https://drive.google.com/file/d/1hZV5mdaPCN93BK6bYZeX2h9y5lx3R2hS/view?usp=sharing
【问题讨论】:
-
docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html - 我不确定这是否可以适应 - 或本机网络应用程序事件.. developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event。我接触到移动应用程序 - 来自 Ionic - 你通过 Angular 连接到本地 webAPI 的东西。还没有为 Android 开发过原生 Java。
标签: java android bluetooth hid