Ah ok, so even if a frame is visible as long as it doesn't want input, then the input goes to the engine and the player view is responsive as normal. Then I can probably just make an invisible parent frame for the HUD elements that's always visible and enable/disable input.
I really didn't need all the functionality of a frame, but at the same time I wasn't clear on how VGUI2 handled input and popups so I felt more comfortable just writing the limited functionality I needed. Thanks for all the help Alfred, I'll respond with how things go. On 8/3/05, Alfred Reynolds <[EMAIL PROTECTED]> wrote: > Just use a frame and control mouse and keyboard input via the > SetMouseInputEnabled()/SetKeyboardInputEnabled() control functions. > Visibility of VGUI2 panels is controlled by the parent (if any parent is > invisible then that panel is invisible). > > Keyboard and mouse focus (and whether it is enabled) is controlled at > the popup (frame) level. If any popup is visible AND wants > keyboard/mouse input then the selected input is forwarded to that panel > (otherwise it goes to the engine). > > It sounds like you should use a Frame and just use the > SetMouseInputEnabled()/SetKeyboardInputEnabled() function calls to > enable/disable keyboard/mouse input based upon your game logic. > > If you try and fight VGUI2 for control of the mouse you will end up > tearing your hair out (and rewriting the entire input system because you > don't want to use a Frame seems a bit silly). > > - Alfred > > ----Original Message---- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Skyler York > Sent: Wednesday, August 03, 2005 12:51 PM To: > [email protected] Subject: Re: [hlcoders] Panel input / > VGUI context > > > I see. I just wasn't sure how the HUD elements would behave if they > > became Frames, or if I made them children of a frame, i.e. if they > > would disappear went the parent went invisible. I also wasn't sure > > if they would grab the input all the time since they'd be visible all > > the time. > > > > I could also easily implement my own miniature user interface > > entirely within the SDK just by grabbing the cursor position and > > doing my own handling. The only problem I've been having with that > > the mouse is reset to the center of the screen each frame so that it > > can do view input, but whenever I call ActivateMouse() and > > DeactivateMouse() on my own, the engine is calling IN_ActivateMouse() > > and IN_DeactivateMouse() and overriding my calls. I was wondering if > > it would be OK to stub out those calls so they don't interfere with > > what I'm doing, or if those calls are necessary for the VGUI2 system > > to operate (since they appear to be what couples/decouples the mouse > > from the view). I can also think of a few other ways to get around > > this, but they're pretty hacky and involve setting up my own hooks > > all over the input code. It would be nice just to use the system in > > place. > > > > On 8/2/05, Alfred Reynolds <[EMAIL PROTECTED]> wrote: > > > You should use a Frame, that is the base container for rendering and > > > keyboard/mouse focus. Trying to do it manually will just involve a > > > lot > > > of fighting the built in VGUI2 system. > > > > > > - Alfred > > > > > > ----Original Message---- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of Skyler > > > York > > > Sent: Tuesday, August 02, 2005 7:44 PM To: > > > [email protected] Subject: [hlcoders] Panel input / > > > VGUI > > > context > > > > > > > I'm playing around with the idea of an interactive HUD, and I want > > > > the element panels on screen to be able to respond to user input. > > > > That's not the heart of the problem though, the problem is > > > > actually getting the engine to switch into the VGUI context, > > > > where a cursor appears and all mouse and keyboard input is fed to > > > > the VGUI system (such as frame has focus). As of right now, the > > > > only way I've seen that happen is using a Frame, or more > > > > specifically through a popup registered with > > > > ISurface::CreatePopup. I'd like to get this behavior without > > > > dealing with the popup system but am unsure as to how to work > > > > with the surface interface to accomplish what I want. I see some > > > > functions such as LockCursor() and UnlockCursor(), but don't know > > > > if those are the functions I'm looking for or the proper way to > > > > use them. > > > > > > > > I suspect that one of the Valve folks would know best, but anyone > > > > who might know something go ahead and chime in :) > > > > > > > > _______________________________________________ > > > > To unsubscribe, edit your list preferences, or view the list > > > > archives, please visit: > > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view the list > > > archives, please visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list > > archives, please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, please > visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

