How to programmatically check the result of Binding mouse events


I crafted a python + wxpython application which in general works very fine on a raspberry pi. However, sometimes (looks very random to me) just after powering on the mouse event (wx.EVT_LEFT_DOWN, that’s all) I programmed on a CustomPanel (based on wx.Panel) does not process the event function.

Most of he time simply rebooting the PI solves this. So I investigated USB mouse events the low level way (sudo modprobe usbmon, sudo cat /sys/kernel/debug/usb/usbmon/1u) and this shows lot of usb trafic when moving and clicking mouse.

So basically I ‘think’ that the Bind statement I use just does not always results in my eventhandler beeing executed. Leaves me with questions:

How could I programmatically check the result of a Bind method call ?
Is there anoyther way I could use to tackle this issue ?

TIA, Adriaan

You can use WIT to monitor events as wxPython sees them. Pick a window to monitor on the left, and “Events” in the toolbar will show you events as they arrive. If what you see is the event stream drying up in WIT, then there might be an issue with the platform port.

What do you mean by powering on the event? Do you repeatedly Bind and Unbind events? That’s probably not a good idea.

If you can reduce your program to the simplest possible form that still displays the problem, then you could show us that and we might be able to spot some issue.

Thank, I’ll have a look at WIT (again).
By “powering on” I meant powering on the raspberry PI (not the events). The strange thing I noticed after a lot of trail and error is that the “missing” mouse evenst happen just after powering on the PI. My application starts automatically after the userid PI automatically is logged in after “powering up”. When in such a situation I can close my application (because I have a physical keyboard and mouse attached to my test system) and start my application again. After that all works fine…

But my goal is to have a kiosk like application for visitors of a museum. The raspbery pi’s are in the public part of a museum and should be used by visitors. The PI’s are in fact sort of media players connected to IIyama touch screens. No keyboard and mouse.

My Proof of Concept setup worked perfect up until some minor update of Raspbian OS or my own software. Digging deeper this weekend

You should probably file an issue on the wxWidgets tracker. They see things through C++ - coloured glasses, but they’re friendly enough if you can demonstrate the issue with wxPython. You will need to whittle down your program to the simplest possible reproducer, though.