LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire data input.vi - key pressed after closing windows user section

Hello everyone,

 

I found a bug on "Acquire data input.vi", this bug appears when the user disconnect from a windows section using keyboard shortcut "LeftWindows" + "L" and either LabVIEW or LabVIEW runtime is running. Then when the user connect back to its user session "Acquire data input.vi" return some Keys pressed : "L", "LeftWindows" and "Escape"

Same will happen with "Ctrl"+"Alt"+"Supp" shortcut with opening the task manager then "LCtrl" or "Lalt" may be  stuck on "Key pressed" state.

This bug is present at least from LabVIEW2013 and still now on LabVIEW2025

Those keys pressed will stay pressed until someone hit the corresponding keys. I think it's happening because LabVIEW runtime don't get the release event that's occurring

Loucoume_1-1743767660030.png

 

Loucoume_0-1743767535079.png

I wonder if someone have a solution to solve this issue (keeping using "Acquire data input.vi"). because the only solution I have found so far is to ask the user to stroke the virtualy stucked keys...

0 Kudos
Message 1 of 4
(94 Views)

Hello Loucoume,

 

I don't think this can really be considered a “bug.”

 

When you log out of your session using WIN + L or access the security screen using WIN + alt + supr, LabVIEW stops monitoring the “Key-up” event, which is used to detect when a key is no longer being pressed.

As a result, the software thinks some keys are still being held down, even though they are not.

 

To my knowledge, there are two possible workarounds for this issue:

  • The first is to ask the user to press the affected keys again, but as you mentioned, this is not ideal.
  • The second would be to use a DLL call to a Windows API such as GetAsyncKeyState or RegisterRawInputDevices in C/C++, integrated via a Call Library Function Node, but this solution is significantly more complex.
0 Kudos
Message 2 of 4
(35 Views)

Hello Zak,

 

Thanks for your reply, I had try something with GetKeyboardState and SetKeyboardState from user32.dll without success even if the keyboard state array seems to change behavior depending on those "key pressed state". 

 

I will try with GetAsyncKeyState or RegisterRawInputDevicestry if I can solve that issue. I will send my results here.

0 Kudos
Message 3 of 4
(18 Views)

No problem !

 

I just hope you will manage to make it work ! 😉

0 Kudos
Message 4 of 4
(7 Views)