[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: [hatari-devel] Recent SDL GUI key up event patch
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Sun, 7 Jul 2024 07:15:02 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1720329306; bh=xdkB1nMzNwcGiWow4bEl3qbQOQAymxGWQxRcYfbfgkk=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=z/WDLqHaZipU850TS5FnWITce+08AwMmXLePTsgGtVOEBmkl94khEHLq+c+VOZeyW uMet9Bxp6gYu4g2IV4F+hNvtxLiJmcVrCzKpJqFeg3OJDDtz5+PmflLGxQ9AIQUvQ2 AZmLWaO7f3isNwfgPHXhoxY5ZVrmtoMV6e3/BmLZR6IonSnTh2d97que7MrkekYlJV AML9mzMVZuCau1nhvptOUGPC12hDeHMdEKG8hcFlf9ZIYtg7ujapLY2xqJ+Nj8B/g6 YDS1+Va8AtiK/95NApG5m+bi4DkHAJcVGFPyEEb/mkOK7sG3ZcUu1A5FHhUpL60k7+ dATZKMRTEIYVA==
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.
This makes sure all keys are released and clears all queued key up events. In case the scancodes for return, space or escape are not mapped to the matching key codes this will still work and it requires less extra code in other places.
Regards,
Andreas