You can't have the scoreboard intercept keyboard events
(SetKeyBoardInputEnabled(false) must be set) if you want the engine to
process them ( which also means OnKeyCodePressed() won't be called as
the scoreboard won't get key presses).
- Alfred
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Imperio59
Sent: Wednesday, February 16, 2005 5:30 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] VGUI is trapping the keyboard code!!!
Hi,
I added a OnKeyCodePressed function to the scoreboard to intercept the
jump key events and toggle the mouse on and off when the user presses
the jump key (keycode is getched with
gameuifuncs->GetVGUI2KeyCodeForBind( "jump" ); )
All worked fine and dandy till i realised that this effectively prevents
any movement while my scoreboard is up (mouse mode or no mouse mode).
I poked around and found that the client.dll needs to tell the engine
wether or not to handle the key event (for such things as chatting).
This is also fine but i don't see the code for this in the vgui2.lib
project.
So my question is simple, how do i make it so my panel doesn't "trap"
the code and so that it gets processed on the server even when the
scoreboard is up?
Here's the function: (m_iJumpKey is the ID of the key corresponding to
the "jump" bind.) void CClientScoreBoardDialog::OnKeyCodePressed(KeyCode
code) {
if (m_iJumpKey != KEY_NONE && m_iJumpKey == code )
{
if (m_bInMouseMode)
SetMouseInputEnabled(false);
else
SetMouseInputEnabled(true);
m_bInMouseMode = !m_bInMouseMode;
}
else
{
BaseClass::OnKeyCodePressed( code );
}
}
The BaseClass (vgui::Panel) only handles the escape key...
I wouldn't mind using say right click mouse to toggle, but to capture
that event i need to SetMouseInputEnabled(true); wich pops up the cursor
anyways and doesn't help me at all...
Thanks in advance...
Imperio59.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005
___
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