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

Detect multiple button presses #20

Open
ggirou opened this issue May 1, 2020 · 0 comments
Open

Detect multiple button presses #20

ggirou opened this issue May 1, 2020 · 0 comments

Comments

@ggirou
Copy link

ggirou commented May 1, 2020

I'd like to detect if 2 or 3 buttons are pressed at the same time.
Is it possible to do that?

With the following code:

@rainbowhat.touch.A.press()
def press(button):
    print("A %s B %s C %s" % (rainbowhat.touch.A.pressed, rainbowhat.touch.B.pressed, rainbowhat.touch.C.pressed))

@rainbowhat.touch.B.press()
def press(button):
    print("A %s B %s C %s" % (rainbowhat.touch.A.pressed, rainbowhat.touch.B.pressed, rainbowhat.touch.C.pressed))

If I pressed A and B at the same time, it should output:

A True B True C False

But I only have:

A True B False C False
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

1 participant