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

Cannot set the delay sent between items in queue. #4

Open
bobsupercow opened this issue Jul 28, 2022 · 4 comments
Open

Cannot set the delay sent between items in queue. #4

bobsupercow opened this issue Jul 28, 2022 · 4 comments
Labels
good first issue Good for newcomers

Comments

@bobsupercow
Copy link

bobsupercow commented Jul 28, 2022

Currently using the library, we are unable to set the delay used between items in the queue as they are processed.
Using the following code actually results in repeated input of the keycode instead of a single instance each second as expected. Perhaps the delay between queue items is to short for the host to recognize, but it isn't tunable externally to verify via testing.

delay(1000);
bluemicro_hid.keyboardReport(0, keycode);
bluemicro_hid.keyboardRelease();
bluemicro_hid.processQueues(CONNECTION_MODE_USB_ONLY);

Using the following code, which is essentially inserting a false delay and processing the input and release separately, works as expected, with a single keypress processed each second.

delay(1000);
bluemicro_hid.keyboardReport(0, keycode);
bluemicro_hid.processQueues(CONNECTION_MODE_USB_ONLY);
delay(10);
bluemicro_hid.keyboardRelease();
bluemicro_hid.processQueues(CONNECTION_MODE_USB_ONLY);
@jpconstantineau
Copy link
Owner

This could be implemented as follows:
1 - set a private variable with default value in the constructor
2 - refactor code to use variable instead of hardcoded delay
3 - add getter/setter methods to update the value if needed.

@jpconstantineau
Copy link
Owner

Variable is already there
Setter is already there

variable isn't used in functions that need it.
here, here and here for USB

here, here and here for BLE

@jpconstantineau jpconstantineau added the good first issue Good for newcomers label Jul 29, 2022
@jpconstantineau
Copy link
Owner

Setter should also be documented in readme

@jpconstantineau
Copy link
Owner

I just did a release that should address this issue. Let me know if it works.
Arduino should pull it in a few hours.

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

No branches or pull requests

2 participants