Skip to content

Commit

Permalink
engine: platform: sdl: we must notify the engine about the unpressed …
Browse files Browse the repository at this point in the history
…button when text input was activated
  • Loading branch information
a1batross committed Jun 15, 2024
1 parent f62aa05 commit f7e1258
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions engine/platform/sdl/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit f7e1258

Please sign in to comment.