01-24-2012 06:41 PM
Hi LabViewers,
I'm trying to make a function to display a video feed in full screen, based on a key press event, then the full screen will close when another key is pressed. I have it working but a problem sometimes occurs when the focus moves to the subVI (full screen VI) and away from the main VI - this stops the key presses from being registered, so you cannot close the window (all window borders etc. are removed). If I place the event structure in the subVI, the live video stops working, and you just get a single frame, because the event structure pauses the subVI. Sorry I can't post the full code, but I could make a simplified version if needed.
I need a way of always monitoring the keyboard events even when the subVI is in focus. At the moment, I have to click the Windows taskbar tab to bring focus back to the main VI in order for keys to be noticed. I'm not sure what causes focus to move to the subVI - sometimes I can click the image control to zoom in etc. on the subVI and the main VI key event still works, other times it doesn't.
Thanks in advance for any advice you can give.
01-24-2012 10:46 PM
Well, its doing what it is supposed to. Event structure will monitor the controls on an active front panel.
If all you are doing with the event structure is to monitor keyboard, Use Acquire Input Data to read the keyboard. This post may be of use: http://forums.ni.com/t5/LabVIEW/getting-char-form-keybaoard/m-p/1806086#M622115
The other question is what is the subVI doing, if the user need not see the subVI front panel? Why display it at all? If it is required, can you display this on a sub panel?
01-25-2012 05:53 PM
Thanks for the information, I'll explain a bit more what each VI does. The event structure in the main VI monitors all the front panel controls and sends instructions to the state machine in another loop, which processes the data. The subVI opens when F11 is pressed, displaying the image in full screen. The escape key closes the subVI when focus is on the main VI. The sub VI is an IMAQ image control with properties set so that it displays full screen. It also contains a state machine to set or get the current front panel display state, going between closed and maximised. I will try and find the VI you suggested in the link. Thanks!
02-13-2012 07:42 AM
Hi MadScientist,
Could you not have the event structure in the subVI but in a sperate loop so that it doesn't pause the video feed but could still send a value to the viedo feed loop to tell it to stop being in fullscreen mdoe (probably with a local variable)?