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

feat: [#2460] add support for wasButtonPressed and wasButtonReleased #2461

Merged
merged 4 commits into from
Aug 13, 2022

Conversation

mattjennings
Copy link
Contributor

@mattjennings mattjennings commented Aug 12, 2022

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

Closes #2460

Changes:

  • add support for gamepad wasButtonPressed and wasButtonReleased

@mattjennings mattjennings marked this pull request as ready for review August 12, 2022 23:47
@mattjennings
Copy link
Contributor Author

mattjennings commented Aug 12, 2022

@eonarheim let me know what you think of these changes. I searched for existing test suites for gamepad's isButtonPressed so I could add ones for these new methods, but I only found it referenced in a sandbox, so I updated that instead. If you think there's an appropriate way to test it then I'd be happy to do that!

This doesn't contain the proposed change of renaming isButtonPressed to isButtonHeld as I'm not sure if we're in favour of that or not.

@eonarheim
Copy link
Member

@mattjennings That's fine, the sandbox should be okay since there are no unit tests (and I'm not positive how I would unit test the GamePad API either)

I mentioned in the issue, but I'm in favor of the name change for consistency 👍 we can mark the old name @deprecated in the jsdoc and changelog.

@mattjennings
Copy link
Contributor Author

@eonarheim perfect, should be good to go now!

Copy link
Member

@eonarheim eonarheim left a comment

Choose a reason for hiding this comment

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

@mattjennings Looks awesome! Thanks again!

@eonarheim eonarheim merged commit fc9bcd0 into excaliburjs:main Aug 13, 2022
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.

Support "wasPressed" and "wasReleased" for Gamepad input
2 participants