Skip to content

usb/usb-device-keyboard: Add key release. #892

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amogha1234
Copy link

Micropython 1.23 preview version is used with Raspberry pi pico w board.
Trying to send keys using usb-keyboard library. It was clicking the key, but not releasing it, similar to #873 . Resulting in continuous sending key.
Hence added release_all() function, which releases all keys. And it worked with Rpi pico w.

Signed-off-by: amogha1234 <amoghahorabyl2002@gmail.com>
Signed-off-by: amogha1234 <amoghahorabyl2002@gmail.com>
@dpgeorge
Copy link
Member

dpgeorge commented Jul 4, 2024

You should be able to release all keys by calling keyboard.send_keys(()), ie pass an empty tuple (or empty list [] but an empty tuple is more efficient because it doesn't allocate memory).

@amogha1234
Copy link
Author

You should be able to release all keys by calling keyboard.send_keys(()), ie pass an empty tuple (or empty list [] but an empty tuple is more efficient because it doesn't allocate memory).

Thank you,
I thought it is better to have a dedicated function to release keys as it is present in other keyboard libraries of circuit-python and Arduino, it will be useful for the users.

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

Successfully merging this pull request may close these issues.

2 participants