tinygo-keyboard
tinygo-keyboard copied to clipboard
WIP: BLE HID
This PR adds support for BLE HID.
To make it work correctly, you need to change the max_len in github.com/funkycode/bluetooth's gatts_d.go to 144.
At least on Android 14, it seems to be working reasonably well. It's not working on Windows.
Here's what is added in this PR:
Connect to the host using BLE HID.
Connect split keyboards to each other using BLE.
Please check the implementation examples below. However, there is still a possibility of changes to the API, etc.
- Connect to the host using BLE HID.
- https://github.com/sago35/tinygo-keyboard/blob/fde11c000fdef1b0c6813fffc7f0e05a13ac4a90/targets/sgkey2/main.go#L75-L81
- Connect split keyboards to each other using BLE.
- https://github.com/sago35/tinygo-keyboard/blob/fde11c000fdef1b0c6813fffc7f0e05a13ac4a90/targets/sgkey2/main.go#L61-L73
- https://github.com/sago35/tinygo-keyboard/blob/fde11c000fdef1b0c6813fffc7f0e05a13ac4a90/targets/xiao-kb012/main.go#L106-L112
Media keys sometimes work, but sometimes they don't. The mouse still doesn't work. Layer keys (KeyModX and KeyTo) are working.
I have created a rebased version on the latest origin/main using the patched version of tinygo.org/x/bluetooth mentioned in #48. I will close this PR.