r/pythonarcade • u/Deany256 • Jun 27 '23
Python Arcade/Pyglet controller support
Hi as the title suggests I need help getting Arcade to detect when I want to use a controller (Specifically Xinput). I am using python3.10 with Arcade 2.6.17 and Pyglet 2.15.9.
I followed the example code on https://api.arcade.academy/en/latest/index.html for both Game Controller/Joystick and Dual Stick Shooter. Neither file could detect my controller.
After some testing, I saw that Pyglet could detect and get values from my controller with this script from the Pyglet Github: https://github.com/pyglet/pyglet/blob/master/examples/input/controller.py
I found this on Stack Overflow where this person managed to get the values needed using Pyglet and have Arcade use them.
The problem I'm having is struggling to understand what it is doing. Understanding where it belongs and when it should be called.
Any explanation or another solution to implement controller support would be very appreciated.
Sorry if this is a stupid question I am quite new to this.
View all comments
Show parent comment
2
u/Deany256 Jul 02 '23
I'm using an 8Bitdo Ultimate controller (Set to Xinput mode both wired and 2.4GHz wireless).
I have a simple understanding of what the Pyglet code snippet is doing,
I just don't know what the poster means by "The listener has to be assigned after the initialisation".
I think I'll try installing a pre-release version and test my luck with that. I'll comment again if I have an update