LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enter key runs program

I'd like the enter key on the keyboard to start the program just like left clicking the TEST button (see attached jpeg). Currently I'm just moving the focus to the TEST button at the appropriate times (load program, after running a test, after selecting the main page, after Part Numbber value change).

But it doesn't seem very clean, for instance the operator can use the mouse to click anywhere on the main page other than the TEST button, and it loses its foucs.

Do I need to keep writing code to move the focus back, or there a better way to do this?


~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 4
(2,577 Views)
  1. right-click on your "test" button and go to "advanced...key navigation".
  2. Now assign it the return key.

See if this helps, maybe. 🙂

Message 2 of 4
(2,573 Views)


@Pablop wrote:
for instance the operator can use the mouse to click anywhere on the main page other than the TEST button, and it loses its foucs.

Do I need to keep writing code to move the focus back, or there a better way to do this?




Hi Pablop,

Definitely the way shown by Altenbach is the better one than what I m going to suggest you now.

If you want the Test button to have the focus even if the Operator clicks anywhere on the FP, then you ve to use the Event Structure wherein you need to code in the Timeout event for the Test button keyfocus.

We need to know what type of coding you ve done till now, whethere Event-based or not. That will shed more light for guiding you.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 3 of 4
(2,563 Views)
Thanks altenbach,

Not much in the help file about this option. I experimented a little with it ot get the best resutls. Turns out setting the "Toggle" section to "Enter" as opposed to the "Focus" section, does the trick. It's nice that it only works if the associated pane is active. I wouldn't want to be on another pane and have the nter key start the test.


~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 4
(2,535 Views)