2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-17 07:27:57 +01:00

engine: platform: sdl: we must notify the engine about the unpressed button when text input was activated

This commit is contained in:
Alibek Omarov 2024-06-15 08:44:07 +03:00
parent f62aa051c8
commit f7e12586cf

View File

@ -156,21 +156,18 @@ static void SDLash_KeyEvent( SDL_KeyboardEvent key )
}
#endif
if( SDL_IsTextInputActive( ))
if( SDL_IsTextInputActive( ) && down )
{
// this is how engine understands ctrl+c, ctrl+v and other hotkeys
if( down && cls.key_dest != key_game )
if( cls.key_dest != key_game && FBitSet( SDL_GetModState(), KMOD_CTRL ))
{
if( FBitSet( SDL_GetModState(), KMOD_CTRL ))
if( keynum >= SDL_SCANCODE_A && keynum <= SDL_SCANCODE_Z )
{
if( keynum >= SDL_SCANCODE_A && keynum <= SDL_SCANCODE_Z )
{
keynum = keynum - SDL_SCANCODE_A + 1;
CL_CharEvent( keynum );
}
return;
keynum = keynum - SDL_SCANCODE_A + 1;
CL_CharEvent( keynum );
}
return;
}
#if SDL_VERSION_ATLEAST( 2, 0, 0 )