ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows
commit17aed147c07b2d7d6a985361466ed4f673a22300
authorVolker Rümelin <vr_qemu@t-online.de>
Tue, 18 Apr 2023 06:56:52 +0000 (18 08:56 +0200)
committerStefan Weil <sw@weilnetz.de>
Mon, 24 Apr 2023 03:06:37 +0000 (24 05:06 +0200)
tree809291be9f1581b4464b1842019bafd3d12846c0
parentc8c98f0911cb1031dc1b4864c3c98754b8a7efe0
ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows

Windows sends an extra left control key up/down input event for
every right alt key up/down input event for keyboards with
international layout. Since commit 830473455f ("ui/sdl2: fix
handling of AltGr key on Windows") QEMU uses a Windows low level
keyboard hook procedure to reliably filter out the special left
control key and to grab the keyboard on Windows.

The SDL2 version 2.0.16 introduced its own Windows low level
keyboard hook procedure to grab the keyboard. Windows calls this
callback before the QEMU keyboard hook procedure. This disables
the special left control key filter when the keyboard is grabbed.

To fix the problem, disable the SDL2 Windows low level keyboard
hook procedure.

Reported-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Tested-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20230418065652.7152-1-vr_qemu@t-online.de>
ui/sdl2.c