LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically check a VI for the existence of hotkeys/short cuts/key navigation

Solved!
Go to solution

Hi everyone,

 

Is there any way that I can detect whether controls in a VI (acces by strictly typed VI reference) have been associated with a shortcut key?

 

I am only interested in the boolean output, but for a more general user the problem could be to programmatically map the specific shortcuts of an ensemble of VI's (or just one) to get an overview or for documentation purposes

 

Thank you all in advance - I hope the problem is described precisely enough.

 

Mikkel

0 Kudos
Message 1 of 5
(1,419 Views)

Different types of controls have different types of shortcuts. For example, a Boolean has a Toggle Key Binding and a Numeric has Increment and Decrement key bindings (and they both have a Focus key binding). If you are just interested in specific shortcuts like Toggle for Booleans this isn't bad at all, just a few property nodes and a For Loop. If you want it to report all shortcuts, you'll have to iterate through the array of control refs, figure out which specific class each one belongs to and convert the ref to that class, then get the shortcut(s). Here is the start of something for the more complicated case.

Spoiler
Get Shortcuts.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 2 of 5
(1,416 Views)

Thank you FireFist-Redhawk - Kudo's coming up

 

Your code was exactly what I needed - the special case and I was close - only thing is that it throws an error when running.

 

I have attached the code with my small addendums

 

Must admit I have not investigated the fault (you are the easy/fast solution)

Download All
0 Kudos
Message 3 of 5
(1,375 Views)
Solution
Accepted by topic author MikeBravo74

Just a stupid mistake on my part, was getting the class name of the label instead of the class name of the object. Dunno when the class name of a label would ever be something other than Text, but oh well. This one I actually ran lol... I also added just a smidge of code to make it work a little better.

Spoiler
Get Shortcuts.png
Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 4 of 5
(1,365 Views)

Thanks for swift reply and solution

0 Kudos
Message 5 of 5
(1,347 Views)