LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ring control with keyboard shortcut

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

Message Edited by YL_2009 on 11-19-2009 02:22 PM
0 Kudos
Message 1 of 2
(2,576 Views)

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. 

 

0 Kudos
Message 2 of 2
(2,552 Views)