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

BLE keyboard (ESP32) sends repeating of keys after a single key due to gatts_notify( ) #13

Closed
vsupacha opened this issue Feb 25, 2023 · 3 comments

Comments

@vsupacha
Copy link

Error scenario:
MicroPython v1.19.1 for ESP32.
async keyboard example.
A single key causes non-stop repeating of keys.
Defect is found to be the calling of self._ble.gatts_notify(self.conn_handle, self.h_rep, state) in notify_hid_report( ).

Preliminary fix
Call Keyboard.set_keys( ) without arguments, followed by Keyboard.notify_hid_report( ) after the original code.

@Heerkog
Copy link
Owner

Heerkog commented Feb 25, 2023

A single key causes non-stop repeating of keys.

Is the key pressed (i.e., pushed down and released) or held (i.e., continuously pushed down)?

  • In case of the first, the release of the key should call Keyboard.set_keys() with empty bits, followed by Keyboard.notify_hid_report() as suggested.
  • In case of the second, this is intended behavior.

@vsupacha
Copy link
Author

vsupacha commented Feb 26, 2023

The key was pressed and released. So I expect that the update in the bluetooth module may break the previous behavior.

BTW, thanks for your code. The module helps me a lot in order to make a game controller for a PC web game.

@Heerkog
Copy link
Owner

Heerkog commented Feb 26, 2023

The key was pressed and released. So I expect that the update in the bluetooth module may break the previous behavior.

Do you have a source for this update? I don't see changes in the documentation.

BTW, thanks for your code. The module helps me a lot in order to make a game controller for a PC web game.

I'm glad my code could help you! Appreciate the feedback!

@Heerkog Heerkog closed this as completed Aug 6, 2024
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

2 participants