From: Stefan Weil via <qemu-devel@nongnu.org>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Volker Rümelin" <vr_qemu@t-online.de>
Cc: Howard Spoelstra <hsp.cat7@gmail.com>,
Bernhard Beschow <shentey@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/3] ui/sdl2: reenable the SDL2 Windows keyboard hook procedure
Date: Mon, 9 Sep 2024 10:02:15 +0200 [thread overview]
Message-ID: <e06b0915-c819-4e03-8864-03afe72dbdae@weilnetz.de> (raw)
In-Reply-To: <CAMxuvay4vRm6ZYQoUx=cmD5mr-8-qR4Z4iLEJ6-f0m2eUSbdOg@mail.gmail.com>
Am 09.09.24 um 09:26 schrieb Marc-André Lureau:
> Hi
>
> On Mon, Sep 9, 2024 at 10:22 AM Volker Rümelin <vr_qemu@t-online.de> wrote:
>> Windows only:
>>
>> The libSDL2 Windows message loop needs the libSDL2 Windows low
>> level keyboard hook procedure to grab the left and right Windows
>> keys correctly. Reenable the SDL2 Windows keyboard hook procedure.
>>
>> Because the QEMU Windows keyboard hook procedure is still needed
>> to filter out the special left Control key event for every Alt Gr
>> key event, it's important to install the two keyboard hook
>> procedures in the following order. First the SDL2 procedure, then
>> the QEMU procedure.
>>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2139
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2323
>> Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
>> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
>> ---
>> ui/sdl2.c | 53 ++++++++++++++++++++++++++++++---------------
>> ui/win32-kbd-hook.c | 3 +++
>> 2 files changed, 38 insertions(+), 18 deletions(-)
>>
>> diff --git a/ui/sdl2.c b/ui/sdl2.c
>> index 98ed974371..ac37c173a1 100644
>> --- a/ui/sdl2.c
>> +++ b/ui/sdl2.c
[...]
>> @@ -877,6 +883,17 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
>> SDL_EnableScreenSaver();
>> memset(&info, 0, sizeof(info));
>> SDL_VERSION(&info.version);
>> + /*
>> + * Since version 2.16.0 under Windows, SDL2 has its own low level
>> + * keyboard hook procedure to grab the keyboard. The remaining task of
>> + * QEMU's low level keyboard hook procedure is to filter out the special
>> + * left Control up/down key event for every Alt Gr key event on keyboards
>> + * with an international layout.
>> + */
>> + SDL_GetVersion(&ver);
>> + if (ver.major == 2 && ver.minor < 16) {
>> + win32_kbd_grab = true;
>> + }
>>
> Note: there is no 2.16 release. They jumped from 2.0.22 to 2.24 (see
> https://github.com/libsdl-org/SDL/releases/tag/release-2.24.0)
>
> The windows hook was indeed added in 2.0.16, released on Aug 10, 2021.
>
> Given the distribution nature of the Windows binaries, I think we
> could simply depend on a much recent version without worrying about
> compatibility with < 2.0.16. This would help reduce the potential
> combinations of versions and bugs reports.
[...]
I agree. My builds for Windows typically use the very latest versions,
for example mingw-w64-i686-SDL2-2.30.7-1-any for the next build. So
depending on a recent SDL version would be fine for me.
Stefan W.
next prev parent reply other threads:[~2024-09-09 8:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 6:12 SDL2 keyboard fixes on Windows Volker Rümelin
2024-09-09 6:15 ` [PATCH 1/3] ui/sdl2: reenable the SDL2 Windows keyboard hook procedure Volker Rümelin
2024-09-09 7:26 ` Marc-André Lureau
2024-09-09 8:02 ` Stefan Weil via [this message]
2024-09-09 19:38 ` Volker Rümelin
2024-09-11 11:57 ` Philippe Mathieu-Daudé
2024-09-11 11:59 ` Philippe Mathieu-Daudé
2024-09-11 12:16 ` Bernhard Beschow
2024-12-07 12:46 ` Bernhard Beschow
2024-09-09 6:15 ` [PATCH 2/3] ui/sdl2: release all modifiers Volker Rümelin
2024-09-09 6:15 ` [PATCH 3/3] ui/sdl2: ignore GUI keys in SDL_TEXTINPUT handler Volker Rümelin
2024-09-11 11:19 ` SDL2 keyboard fixes on Windows Bernhard Beschow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e06b0915-c819-4e03-8864-03afe72dbdae@weilnetz.de \
--to=qemu-devel@nongnu.org \
--cc=hsp.cat7@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=shentey@gmail.com \
--cc=sw@weilnetz.de \
--cc=vr_qemu@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).