LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

focus for front panel

Is there a way to tell if the front panel has keyboard focus?  I have found using the Invoke node that you can set keyboard focus but it only works with the standard window and will not allow the window to stay maximized will applying focus to the front panel.  Is there a way to keep the window maximized and apply focus?
0 Kudos
Message 1 of 6
(4,078 Views)
I'm not sure I understand what you mean by "the standard window and will not allow the window to stay maximized will applying focus to the front panel". Whichever window is the active window (indicated by the color of the titlebar) has focus. Are you sure you're not referring to a specific control having focus?
Message 2 of 6
(4,065 Views)

Hi Randy,

 

I'm not sure I understand what you are asking. Do you want to record the keyboard while focus is on other maximized windows?

 

If so, check out the Basic Input demo.VI in the example finder (can be found if you search for "keyboard"). You should be able to open another window and maximize it and the VI will still catch keystrokes.

Message Edited by Sappster on 09-24-2008 03:25 PM
Sappster
0 Kudos
Message 3 of 6
(4,024 Views)

The problem that I am having is that we are building an application that is designed to be used without a mouse attached to the computer and therefore, the user can not get focus back to the vi if it is lost.  This has happened in the past a couple times when everything is not started up in the right order (computer, remote equipment, ect.) the vi will not end up with focus.  I was hoping that there was a way to ensure that the vi has the dark blue title bar and that the application maintains focus the entire time the computer is on. 

When I try to do this with the Invoke node, I can get it to work with the standard window but it cause the window to not be maximized.  I wanted to setup a check to see if the window has focus and if it does not then reestablish focus only when lost.

0 Kudos
Message 4 of 6
(4,005 Views)

Which Invoke node?

 

Things I can suggest:

 

  • Make the window modal.
  • Make the window into a "floater".
  • Use the lvwutil32 library to control the window (assuming you're running on a Windows operating system).
0 Kudos
Message 5 of 6
(3,992 Views)

Hi Randy,

 

A simple solution is to use the Operating Systems shortcut for switching open windows, alt+tab. Another solution is to minimize and then maximize the front panel. This will bring the front panel to the front of all the open windows. You can also use the lvwutil32, as mentioned by smercurio_fc. This will provide more control, however it is a much more complicated solution that requires calling into a dll.

 

Let me know if you have any questions.

Sappster
0 Kudos
Message 6 of 6
(3,965 Views)