Skip to content

Add "were_pressed" property to cpx #51

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

Closed
wants to merge 1 commit into from
Closed

Conversation

deshipu
Copy link
Contributor

@deshipu deshipu commented May 2, 2019

Adds a "were_pressed" property to cpx, making it possible to check whether a button was pressed since the last check. This uses the gamepad module to constantly poll the buttons state in the background.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -475,6 +478,15 @@ def button_b(self):
"""
return self._b.value

@property
def were_pressed(self):
Copy link
Member

Choose a reason for hiding this comment

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

Needs a docstring.

@evaherrada
Copy link
Collaborator

Should fix #50

@evaherrada
Copy link
Collaborator

Since this hasn't been active in a while, I'll just fork @deshipu 's repo and make a pr with the docstring

@deshipu
Copy link
Contributor Author

deshipu commented Oct 5, 2019

Sorry, I missed this.

@evaherrada
Copy link
Collaborator

Continued in #72

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.

3 participants