05-01-2022 10:03 AM
Hi
I am having a weird problem where the Joystick Input stops updating its values and actually zeroes them whenever I change app, eg. when I select my Web Browser. Surely I can just be carefull and keep the Labview app selected, but I'd prefer if a more robust solution is available as if for any reason my joystick would stop working, could mean serious harm.
I attach a test code with which I can replicate it perfectly fine with my Xbox Controller. Just alt-tab (change app) with anything (even the Block Diagram), have both of them displaying on screen and you should see how the variables stop updating and become zero. Something like this picture.
Not sure why this is happening or how to solve it. Can anyone replicate this?
Thanks in advance!
Regards,
Oscar
05-01-2022 11:01 AM
It's designed behavior. The joystick is an input device just like the keyboard and mouse and the OS will only direct the according messages to whatever application has the keyfocus.
Capturing joystick input as it is entering the system rather than when it is directed to an application by the OS is a little more tricky and requires system filter callback functions being installed. Nothing you can do with LabVIEW only, but it requires a DLL programmed in C(++). Or maybe a .Net assembly.