VGUI Joypad Input in SDK 2013
I need my VGUI panel to capture the left analog stick from the joypad. In 2007 SDK, I was able to do this using the following code:
In 2007, this code would capture the left analog stick and ignore all other joypad input. However, in 2013 SDK this does nothing. This is probably due to the improved controller support in the new SDK. Now you can control the main menu with the dpad on your joystick; you couldn't do that back in 2007.
Does anybody know how to make my VGUI panel capture the left analog stick of the joypad in 2013?
- Code: Select all
void CHDViewInput::OnKeyCodePressed(KeyCode code)
{
if( IsJoystickAxisCode(code) ) {
if( code == KEY_XSTICK1_UP )
m_bMoveUp = true;
else if( code == KEY_XSTICK1_DOWN )
m_bMoveDown = true;
else if( code == KEY_XSTICK1_LEFT )
m_bMoveLeft = true;
else if( code == KEY_XSTICK1_RIGHT )
m_bMoveRight = true;
return;
}
}
In 2007, this code would capture the left analog stick and ignore all other joypad input. However, in 2013 SDK this does nothing. This is probably due to the improved controller support in the new SDK. Now you can control the main menu with the dpad on your joystick; you couldn't do that back in 2007.
Does anybody know how to make my VGUI panel capture the left analog stick of the joypad in 2013?