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

Added joystick support. #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnthonyBriggs
Copy link

(I included some extraneous extra stuff with the last pull request -- this is a shiny new one)

This is an updated version of the 'hack' that I posted last week. A rough outline of what I've done:

  • Added handler functions for all of the pygame joystick functions in game.py. I had to put in a hack for the button parameter mapper though, since the two types of buttons conflict. I also added a print statement to the ValueError handler, since the silent error eating caused me a bit of head scratching.
  • Added constants for joystick buttons and axes into constants.py
  • Added pygame.joystick.init() etc. to the runner, and imported a list of joysticks and the relevant constants in builtins
  • Added a simple test for the joystick button handler. Not 100% sure whether you want more tests, eg. of the joystick movement, or if you think this is overkill?
  • Updated the hooks.rst and builtins.rst docs, including examples :)

Let me know what you think - happy to make changes if you need them.

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.

None yet

1 participant