Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Central example request - HID keyboard #116

Open
ladyada opened this issue Feb 5, 2018 · 8 comments
Open

Central example request - HID keyboard #116

ladyada opened this issue Feb 5, 2018 · 8 comments

Comments

@ladyada
Copy link
Member

ladyada commented Feb 5, 2018

not an immediate need, but an interesting demo would be if the nRF52 was a central to an HID BLE keyboard. hardest part is finding a BLE keyboard (not BT classic!)

@hathach
Copy link
Member

hathach commented Feb 12, 2018

just tried to implement it, parsing characteristic and getting report is easy enough. But most keyboards requires pairing/bonding, which is unfortunately not yet implemented on Central (only Peripherals). I will dig up some docs and try to wrap this up.

@hathach
Copy link
Member

hathach commented Feb 23, 2018

just added the central hid example. i don't have a BLE keyboard to test with but it works well with current prph keyboard running on another feather nrf52. It may be buggy a bit but work as proof of concept.

https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/0.8.x/libraries/Bluefruit52Lib/examples/Central/central_hid/central_hid.ino

@hathach
Copy link
Member

hathach commented Feb 26, 2018

If anyone that has consumer ble keyboard to test with, please let us know if that works out

@microbuilder
Copy link
Contributor

@hathach I can test this out.

One request to close this though is to add a function to map raw HID keycodes to a country-specific keyboard layout.

For example, on a French keyboard, the top-left keys are azerty, so the q keycode needs to be mapped to a, and the w keyboard needs to be mapped to z, etc. We should have a .mapKeycode type function that accepts a lookup table, and returns the country-specific values so that this can be used with any keyboard with a bit of manual labour on behalf of customers (providing a new keymap lookup table).

@microbuilder
Copy link
Contributor

Additional note: The lookup function needs to support multiple keys to know if you are generating special characters, upper-case, etc.

@microbuilder
Copy link
Contributor

The demo looks great and is easy to understand with the callbacks. Great job on this!

@wwwoholic
Copy link

The comment in central_hid example "A additional bluefruit that has bleuart as peripheral is required for the demo" doesn't seem to be right. Also, the notifications for both keyboard and mouse are enabled, but only keyboard reports are handled.

@hathach
Copy link
Member

hathach commented Nov 19, 2018

ah thanks, We will update the comment, the mouse API is similar. We would add it later when having more time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants