Skip to content

Fix keypad EventQueue len(); improve doc #10184

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

dhalbert
Copy link
Collaborator

Tested on a CPB:

import keypad
import board
import time

keys = keypad.Keys((board.BUTTON_A,), value_when_pressed=True, pull=True)

while True:
    print("wait 5 seconds")
    time.sleep(5)
    print(f"{len(keys.events)=}")
    count = 0
    while (keys.events.get()):
        count+= 1
    print(f"{count=}")

Copy link

@Neradoc Neradoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thanks 👍

@dhalbert dhalbert merged commit c27e0da into adafruit:9.2.x Mar 26, 2025
519 checks passed
@dhalbert dhalbert deleted the keypad-length-fix branch March 26, 2025 14:22
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

Successfully merging this pull request may close these issues.

2 participants