Skip to content

RF: Refactor Joystick class#6967

Merged
peircej merged 17 commits intopsychopy:devfrom
mdcutone:dev-rf-joystick-class
Jan 2, 2025
Merged

RF: Refactor Joystick class#6967
peircej merged 17 commits intopsychopy:devfrom
mdcutone:dev-rf-joystick-class

Conversation

@mdcutone
Copy link
Copy Markdown
Member

@mdcutone mdcutone commented Nov 11, 2024

Made some changes the the Joystick class:

  • Module doesn't import libraries other than pyglet unless needed
  • Added methods for scaling axes values
  • New attributes query the device value on access
  • Added docstrings
  • Added static method getAllJoysticks to get a human-readable list of devices
  • Changed id -> deviceIndex to avoid overriding built-in, you can still pass id but we shouldn't allow that in a future version
  • Joystick plugins are possible
  • Joystick mappings can be set

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 618 lines in your changes missing coverage. Please review.

Project coverage is 50.46%. Comparing base (450cdd7) to head (f7c0c7d).
Report is 70 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6967      +/-   ##
==========================================
+ Coverage   41.66%   50.46%   +8.79%     
==========================================
  Files         341      346       +5     
  Lines       62352    62748     +396     
==========================================
+ Hits        25978    31664    +5686     
+ Misses      36374    31084    -5290     
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)

@mdcutone mdcutone marked this pull request as draft November 11, 2024 21:46
@mdcutone
Copy link
Copy Markdown
Member Author

Added attributes for joysticks/gamepads that support spatial and motion tracking (e.g. Oculus Touch controllers).

@mdcutone mdcutone marked this pull request as ready for review December 20, 2024 22:00
@peircej peircej merged commit be30608 into psychopy:dev Jan 2, 2025
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