From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Joystick responsive only while LV window is in focus

Solved!
Go to solution

Hi,

 

I'm using an XBox joystick with the JoystickAcquire.vi

It works, but only as long as any LV window is in focus. If the mouse clicks any other window, no joystick input is collected.

 

This not the case for mouse and keyboard data acquisition.

Is there any solution to this?

 

I attach a simple modification of the example that comes with LV


Thanks,

fbalzarotti1_0-1628711210905.png

 

0 Kudos
Message 1 of 3
(707 Views)

Not sure why you are having a problem.  I don't have LabVIEW 2020 installed, but in LabVIEW 2019, I put an Initialize Joystick outside a While Loop, and a JoystickAcquire function inside the While Loop.  I have a Logitech Wireless Gamepad 710, and when I run my VI and exercise the Gamepad, the indicators inside the Front Panel show action, whether or not Focus is on a LabVIEW Windows or not (other Windows were Google and File Manager).  Maybe something funny with the XBox Controller?

 

Bob Schor

0 Kudos
Message 2 of 3
(679 Views)
Solution
Accepted by topic author fbalzarotti1

Thanks for the input.

 

I realized that indeed this is an XBOX specific issue.

 

This doesn't happen when one uses XINPUT. I had the DLL already in my system here: C:\Windows\System32\XInput1_4.dll
Documentation is found here: https://docs.microsoft.com/en-us/windows/win32/api/xinput/ns-xinput-xinput_gamepad

 

I attach a simple function that reads from the XBOX controller.

Download All
Message 3 of 3
(627 Views)