micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

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

Open amogha1234 opened this issue 1 year ago • 2 comments

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.

amogha1234 avatar Jul 04 '24 05:07 amogha1234

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).

dpgeorge avatar Jul 04 '24 06:07 dpgeorge

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.

amogha1234 avatar Jul 05 '24 07:07 amogha1234