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.
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.
09-28-2021 06:57 AM
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
Solved! Go to Solution.
09-28-2021 07:18 AM - edited 09-28-2021 07:19 AM
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.
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.
09-29-2021 02:01 AM
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)
09-29-2021 07:21 AM
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.
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.
09-29-2021 03:34 PM
Thanks for swift reply and solution