11-19-2009 02:18 PM - edited 11-19-2009 02:22 PM
Sorry, posted this in the wrong forum!
Hi all,
Is there a way to assign shortcut keys to each items in a ring control? The ring control that I have currently has 40 items. My intention is to have it as follows:
[1] Item1
[2] Item2
[3] Item3, etc...
So, once the ring control is active, user can type in "20" to select item #20.
I tried EVENT_KEYPRESS, but as soon as the ring control pop-ups, I can no longer trap any key press events.
Thanks,
YL
11-19-2009 05:42 PM
YL_2009 wrote:Is there a way to assign shortcut keys to each items in a ring control?
No.
The ring control that I have currently has 40 items. My intention is to have it as follows:
[1] Item1
[2] Item2
[3] Item3, etc...
So, once the ring control is active, user can type in "20" to select item #20.
I tried EVENT_KEYPRESS, but as soon as the ring control pop-ups, I can no longer trap any key press events.
Popping up the menu isn't the same as the control having focus for keyboard entry. They are mutually exclusive. One way to do what you want is to basically have to make sure the ring has KeyFocus so you can use the Input Device Control VIs to read the keyboard. You can, for example, set the KeyFocus on a MouseDown event, and unset it for a MouseUp. Then, in the Timeout case for the event structure you can be monitoring the keyboard to see what keys are pressed and act if the ring has KeyFocus. See attached (LV 8.2) as a starting point.