0

Is there any way to embed a joystick or a game controller with an eventlistener in python program pygame?

Gladly also directly with PyQt.

There is a nice widget in Qt for the keyboard. Is there something similar for the gamecontoller?

Many thanks for your help.

  • Sorry, I was browsing from mobile and didn't read the question carefully enough. Qt doesn't support joysticks, only gamepads (see [QtGamepad](//doc.qt.io/qt-5/qtgamepad-index.html)). There is a custom Qt/C++ module ([QJoystick](//github.com/alex-spataru/QJoysticks) meaning that you cannot directly use it on PyQt. There is [pyjoystick](//pypi.org/project/pyjoystick/) (see [this related answer](//stackoverflow.com/a/72053600), an sdl-based python module (which seems to have some sort of Qt integration). Also, if you only use Windows, see [this](//stackoverflow.com/a/72713040) based on pywinusb. – musicamante Oct 18 '22 at 21:32

0 Answers0