LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keyboard focus on indicators

Solved!
Go to solution

I have some code with mouse down events on several Boolean indicators on a panel.

 

I'd like to allow the operator to trigger the existing actions with keystrokes (one key to focus on an indicator, another key (Return for example) to trigger the event), i.e., without using a mouse/touchpad. Looks like indicators aren't included in the tab-focus sequence.

 

Any ideas how to do this?

 

Thanks,

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 27
(5,551 Views)

Either make them controls and update their values using local variables or use the Key Down event for the panel, which will require you to have some additional tracking for what you're updating. Another option is the Key Down? event, which will allow you to discard the event or modify its data.


___________________
Try to take over the world!
0 Kudos
Message 2 of 27
(5,540 Views)

Hi Jeffrey,

 

you can assign (certain) keys to controls in their property dialog.

If that is sufficient I would use a value change event instead of MouseButtonDown or KeyDown events…

 

And no, indicators are excluded from tabbing. With standard UI behaviour you only tab between controls (aka inputs)! You can additionally exclude controls from the tabbing (also in their property dialog)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 27
(5,521 Views)

@tst wrote:

Either make them controls and update their values using local variables or use the Key Down event for the panel, which will require you to have some additional tracking for what you're updating. Another option is the Key Down? event, which will allow you to discard the event or modify its data.


Thanks. I haven't had a chance to try this yet.

 

Some operators might want to click on the boolean (LED) as they've done in the past. If I convert indicators to controls and use local variables, is there a way to lock the controls to prevent manual toggling? Set the enabled state to disabled?

 

Thanks again,

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 4 of 27
(5,491 Views)

Possibly use an event structure to detect a value change for that "indicator" and have it write back its original value.  Though I think there could still be a potential for a race condition when other parts of the program update the "indicator" through a local variable.

 

A hack that may work, but I haven't tried, would be to cover the control with a transparent decoration.  That should at least prevent mouse clicks from activating a button.  Also make sure the control looks like it would be an indicator rather than a control.  For booleans, LED's look like indicators.  Buttons look like controls, even though either can be made into a control or indicator.

0 Kudos
Message 5 of 27
(5,480 Views)

Hi Jeffrey,

 

is there a way to lock the controls to prevent manual toggling? Set the enabled state to disabled?

Yes, exactly: setting the control to disabled will prevent user interaction with this control. But then also key input for this control is disabled…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 27
(5,446 Views)

@MinerHokieRamp wrote:

 

Some operators might want to click on the boolean (LED) as they've done in the past. If I convert indicators to controls and use local variables, is there a way to lock the controls to prevent manual toggling? Set the enabled state to disabled?


That will work, but as Gerd says, will prevent keyboard navigation. You could use the Mouse Down? event for those controls and discard it, but before you go down that path, it sounds to me like you either need to rethink your UI or explain it better to us, because at the moment it sounds like a weird combination of things that you want to allow and disallow and you may be driving yourself down an unnecessary hole of workarounds.


___________________
Try to take over the world!
Message 7 of 27
(5,436 Views)

@GerdW wrote:

Hi Jeffrey,

 

you can assign (certain) keys to controls in their property dialog.

If that is sufficient I would use a value change event instead of MouseButtonDown or KeyDown events…

 

And no, indicators are excluded from tabbing. With standard UI behaviour you only tab between controls (aka inputs)! You can additionally exclude controls from the tabbing (also in their property dialog)…


Yes, I'd like to change the events to Value Change, tabbing through the LEDs and pushing the ENTER key when focus is on the LED of interest.

 

Thus, the operator wouldn't have to use the touchpad.

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 8 of 27
(5,381 Views)

@tst wrote:

@MinerHokieRamp wrote:

 

Some operators might want to click on the boolean (LED) as they've done in the past. If I convert indicators to controls and use local variables, is there a way to lock the controls to prevent manual toggling? Set the enabled state to disabled?


That will work, but as Gerd says, will prevent keyboard navigation. You could use the Mouse Down? event for those controls and discard it, but before you go down that path, it sounds to me like you either need to rethink your UI or explain it better to us, because at the moment it sounds like a weird combination of things that you want to allow and disallow and you may be driving yourself down an unnecessary hole of workarounds.


It's a large array of LEDs (at present, they're indicators), with Mouse Down on each LED triggering an event and causing an info screen to pop up.

 

So the operator doesn't have to use the touchpad, I'd like to tab through the LEDs and push the ENTER key for the pop-up. Thus, I need to tab among the LEDs and make the focus visible to the operator and I need to change event triggers to Value Change.

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 9 of 27
(5,367 Views)

I still don't understand why you want to prevent them from also being able to press the buttons/LEDs with the mouse, but that if that's really what you want, then you've been given a few options.


___________________
Try to take over the world!
0 Kudos
Message 10 of 27
(5,349 Views)