From 7b127c23f5d078c0f538aba732caaf978435d8f3 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sun, 13 Dec 2020 10:11:05 +0300 Subject: [PATCH] client: fix vgui leaving text input move enabled (breaks CTRL in SDL2) --- engine/client/vgui/vgui_draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/client/vgui/vgui_draw.c b/engine/client/vgui/vgui_draw.c index f516a737..e5dc7488 100644 --- a/engine/client/vgui/vgui_draw.c +++ b/engine/client/vgui/vgui_draw.c @@ -121,6 +121,7 @@ void GAME_EXPORT VGUI_CursorSelect(enum VGUI_DefaultCursor cursor ) SDL_ShowCursor( false ); if( host.mouse_visible ) SDL_GetRelativeMouseState( NULL, NULL ); + Key_EnableTextInput( false, true ); } //SDL_SetRelativeMouseMode(false); #endif @@ -146,7 +147,7 @@ void GAME_EXPORT VGUI_SetVisible( qboolean state ) if( !state ) SDL_GetRelativeMouseState( NULL, NULL ); #endif - Key_EnableTextInput( state, true ); + Key_EnableTextInput( false, true ); } int GAME_EXPORT VGUI_UtfProcessChar( int in ) @@ -494,12 +495,11 @@ void VGui_KeyEvent( int key, int down ) if( !vgui.initialized ) return; - if( host.mouse_visible ) - Key_EnableTextInput( true, false ); - switch( key ) { case K_MOUSE1: + if( down && host.mouse_visible ) + Key_EnableTextInput( true, false ); vgui.Mouse( down ? MA_PRESSED : MA_RELEASED, MOUSE_LEFT ); return; case K_MOUSE2: