tinygo-keyboard icon indicating copy to clipboard operation
tinygo-keyboard copied to clipboard

WIP: BLE HID

Open sago35 opened this issue 1 year ago • 1 comments

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

sago35 avatar Nov 16 '23 23:11 sago35

Media keys sometimes work, but sometimes they don't. The mouse still doesn't work. Layer keys (KeyModX and KeyTo) are working.

sago35 avatar Nov 16 '23 23:11 sago35

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.

sago35 avatar Sep 02 '24 14:09 sago35