Browse Source

client: fix vgui leaving text input move enabled (breaks CTRL in SDL2)

pull/2/head
mittorn 4 years ago
parent
commit
7b127c23f5
  1. 8
      engine/client/vgui/vgui_draw.c

8
engine/client/vgui/vgui_draw.c

@ -121,6 +121,7 @@ void GAME_EXPORT VGUI_CursorSelect(enum VGUI_DefaultCursor cursor )
SDL_ShowCursor( false ); SDL_ShowCursor( false );
if( host.mouse_visible ) if( host.mouse_visible )
SDL_GetRelativeMouseState( NULL, NULL ); SDL_GetRelativeMouseState( NULL, NULL );
Key_EnableTextInput( false, true );
} }
//SDL_SetRelativeMouseMode(false); //SDL_SetRelativeMouseMode(false);
#endif #endif
@ -146,7 +147,7 @@ void GAME_EXPORT VGUI_SetVisible( qboolean state )
if( !state ) if( !state )
SDL_GetRelativeMouseState( NULL, NULL ); SDL_GetRelativeMouseState( NULL, NULL );
#endif #endif
Key_EnableTextInput( state, true ); Key_EnableTextInput( false, true );
} }
int GAME_EXPORT VGUI_UtfProcessChar( int in ) int GAME_EXPORT VGUI_UtfProcessChar( int in )
@ -494,12 +495,11 @@ void VGui_KeyEvent( int key, int down )
if( !vgui.initialized ) if( !vgui.initialized )
return; return;
if( host.mouse_visible )
Key_EnableTextInput( true, false );
switch( key ) switch( key )
{ {
case K_MOUSE1: case K_MOUSE1:
if( down && host.mouse_visible )
Key_EnableTextInput( true, false );
vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_LEFT ); vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_LEFT );
return; return;
case K_MOUSE2: case K_MOUSE2:

Loading…
Cancel
Save