From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Disable shortcut keys during runtime?

Solved!
Go to solution

I tried to read through all the threads related to disabling shortcuts, but I can't find a solution to my problem.  I need to test a keyboard for multiple key presses.  Currently, I'm having problem with the shortcut keys being activated, such as ctrl+y, F1, and such.  I want to be able to read those keys instead of having the shortcut pop up.  How can I do this?  I have Labview 8.5 development software.

 

Thanks in advance,

Sinh

0 Kudos
Message 1 of 9
(4,161 Views)
Solution
Accepted by topic author Ex_Fisherman

Try this.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 2 of 9
(4,141 Views)

Thank you Gaurav.  This is exactly what I needed.

0 Kudos
Message 3 of 9
(4,116 Views)

Can somone save this down to LV8.0 and repost it please?

Or maybe a screenshot of the BD?

 

Thanks

0 Kudos
Message 4 of 9
(4,009 Views)

Hi CJSesco,

 

it looks like that:

check.png

The second event case is just the "TimeOut"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(4,007 Views)

Works perfect.

Thank you very much.

0 Kudos
Message 6 of 9
(3,999 Views)

Looking for an alternate method to do this without an event structure.  My implementation uses a state machine with while loops, and is setup to only respond to specific keystrokes/mouse clicks, at specific times.  When in these states, it waits for the user to interract, and can not proceed until they do (by either progressing with the sequence, or aborting it).  

 

When I implement the method provided, it does work when it is in the state that expects F1, but if the user presses F1 at any other time, the event is triggered, and the VI goes into an invalid state (locks up).  I do inderstand that normally an event structure would be the correct implementation for keyboard inputs, but the application needs to respond in different ways depending on the user input, and needs to ignore all user input at other times.  I couldn't figure out a practical way to ignore events while in certain states, so I implemented the statem machine instead.  

 

Any ideas?  Working in LV 2013. Thanks in advance.

 

GSinMN  

0 Kudos
Message 7 of 9
(3,755 Views)

Hi GS,

 

get all keystrokes and decide in the event, if you want them to process or to filter out…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(3,746 Views)

Hello GerdW,

 

  Thanks for the quick response.  Think I may have found another option.  Stumbled across this in the help files:

 

 "Key Down Event 

If a key press matches a keyboard shortcut in the VI menu, such as Ctrl-C or Ctrl-V, LabVIEW does not generate a Key Down event, regardless of whether the menu item is enabled."

 

All I had to do was create a dummy control, assign it the F1 shortcut, and the help file doesn't open.  Catch is that the control has to remain visible on the front panel.  Just need to find creative way to hide it.  

 

Thanks again.

 

GSinMN

0 Kudos
Message 9 of 9
(3,730 Views)