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

unit test and minor fixes to tracked-controls #2396

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

ngokevin
Copy link
Member

@ngokevin ngokevin commented Feb 16, 2017

Description:

Was looking at a controls bug and wanted to sweep up to add coverage.

Changes proposed:

  • Full unit tests, docstrings, comments.
  • Make previous unit tests more clear on what they're testing. Before the test names were a glob of numbers.
  • Move .update() to .updateGamepad() method. Don't need .update() handler since .updateGamepad() is called every tick. Also to not call handlers from other handlers.
  • Better handle initial states. Ensure that events aren't fired on the initial tick if it doesn't make sense to. It seemed many events were being fired due to uninitialized states.
  • Make .handle*() methods more consistent by having them all return a boolean.
  • Make .handleAxes() not take an argument since it's a method and has access to component members
  • Rename this.previousAxis to this.axis since it represents current axis and is not used for any delta calculations.
  • Set initial button states so we don't have to do previousButtonState = buttonStates[id] = buttonStates[id] || {}

@dmarcos dmarcos merged commit 9e8dfcd into aframevr:master Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants