wx.adv.Joystick high CPU usage

Hi All,

Windows 10 & 11, python 3.13, wx 4.2.2.

I have been using the joystick library in wx.adv.Joystick for menu navigation in an emulator front-end I have which I believe is a wx widgets wrapper ?? as there isn’t anything within it that does any real work. Anyway, just invoking the below causes around 15% CPU usage until closed. I’m assuming whatever library this is calling is the problem.

joystick = wx.adv.Joystick(joystick=wx.JOYSTICK1)

This isn’t great at all and I’d assume a real problem for low spec machines

I cant use the alternate ‘inputs’ library as it has serious blocking issues - I did try to use that from a thread which is fine but it still blocks that thread from closing while it waits for a joystick event. Some people have tried to work on this issue and there is a ‘fix’ for WIN but not for LINUX and as my application is cross-platform I really need a better solution.

Has anyone come across this and / or have any suggestions

I have a Microsoft X-Box 360 pad rather than an actual joystick, but the Joystick example in the wxPython Demo does recognise it.

The example responds to movement of the pad’s left joystick and 10 of its buttons.

I tested it using wxPython 4.2.2 gtk3 (phoenix) wxWidgets 3.2.6 + Python 3.12.3 + Linux Mint 22 and ran the htop utility to monitor the cpu usage.

If I keep moving the left stick, the cpu usage will go up to 7 to 13%.

When I stop moving the stick it drops to 0%.

I’m not seeing a continuous 15% cpu usage when idle.