Re: [hatari-devel] Keyup bug in SDL GUI |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Keyup bug in SDL GUI
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Wed, 2 Nov 2022 10:06:50 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1667380014; bh=nAtMXmuBU8RRzburK9eMDEQiLjWi8lVwuX84A6PK65g=; h=Content-Type:From:Mime-Version:Subject:Date:Message-Id:To; b=eAp6NcOTFPNc4RaZuREY693I9KPYhst00eyXSeyA/WyQHwhnQgXvrgsx0uypZxTgL DitUJraPEXSvI9ynUotLpirJKH0ORN8AfNLU88DIijW/DnprBc0q8OQzYTrx+ukBBV agDj4Egs3ogKBhpm1yBIWKRDqh9pSy9LxFTUQA9c+BeWEaALgtH9rMy9dN6iwpB0pj pS49ug7wTkjDKwk5sTyevC64lbbP/ckQi+SP91XrgBXDCTdhCdWbE8RHFDK5wB0MGc Fjzc3Y7///GykmQ85bTpUc5VfWaBMRf19YtD+UC/n9HE8/plG6tA9VCYe0US4yH5RO DU0KiNRDozF8Q==
> Am 31.10.2022 um 19:48 schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>
> Hi,
>
>> On 31.10.2022 20.35, Andreas Grabher wrote:
>> I might have found a bug in the SDL GUI. This scenario:
>> In the guest operating system I confirm some action by pressing enter
>> —> SDL_KEYDOWN with SDLK_RETURN
>> Due to some bug in the OS I get a double fault, which then activates Dialog_HaltDlg() before I am able to release the key
>> I then release the key
>> —> SDL_KEYUP with SDLK_RETURN
>> At this time we are already in the SDL_WaitEvent()-Loop in SDLGui_DoDialogExt() and the event is recognized as key up in the GUI. This leads to automatically pressing the default button which exits the dialog without me having a chance to select anything.
>> Can you confirm this? This will be difficult to fix.
>
> You can wait until all keys are up, before starting accepting input in SDL GUI.
>
> No notify user about this wait, you can show a note about keys being down in statusbar.
>
> If SDL does not provide information about pressed keys, keymap.c keeps count of them.
>
>
> - Eero
>
Maybe calling SDL_ResetKeyboard() before entering the SDL_WaitEvent()-loop would be the solution?