Re: [hatari-devel] Recent SDL GUI key up event patch |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Hatari devel list <hatari-devel@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [hatari-devel] Recent SDL GUI key up event patch
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Sun, 7 Jul 2024 08:24:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1720333476; bh=wev33MFdu1NnMnLNV7RpMzYRm2nOJ73bCK82bi/MaTc=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id; b=hHfSmockhZCis1RzMiJaC3Dgs8kiqmXc/56ujWdbO6MfBqsrsuCRWpPNxvmNTT2sQ klpUKIfwCqUIfNRqtvWEQAVdcOoQmFRERKAxWfO5QLYljY974UMheFCEQeHBGSYnHE JNCGMROOXNTHU2DCNmZzpNxo4pJC42rPsbmMZDR6K4I5V1tEsenM593ZrUgrFoQzGI lnuUGg0iaxtHyWHAJskpBCUVrnFr7OyOQpxOtOpwE3DOCJvu6FWdnMFjEVAi/Wqi8d x84pk40WWWzgzO66lTVn3hjhJRSbydBMh87PFlnkDmHPaT7r0ewKT/duRor0L6kTyL IaWsw89a/K74A==
> Am 07.07.2024 um 08:17 schrieb Thomas Huth <th.huth@xxxxxxxxx>:
>
> Am Sun, 7 Jul 2024 07:15:02 +0200
> schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
>
>> Hello all,
>>
>> I noticed the recent fix for orphaned key up events in SDL GUI. I think this is too complicated and probably unsafe. I suggest calling
>>
>> SDL_ResetKeyboard();
>> SDL_FlushEvent(SDL_KEYUP);
>>
>> instead.
>
> I remembered your mail from many months ago and tried that first, indeed,
> but for some reasons it does not work for me: If I add that sequence e.g.
> to Main_PauseEmulation() or the beginning of SDLGui_DoDialogExt(), the
> button of the exit dialog still gets activated if I e.g. hold down the
> return key and then click the "X" to close the Hatari window. Seems like
> the logic in Hatari works a little bit different than in Previous here?
>
> Thomas
>
>
Does it still fail if you put SDL_PumpEvents() in between?
SDL_ResetKeyboard();
SDL_PumpEvents();
SDL_FlushEvent(SDL_KEYUP);