]> git.proxmox.com Git - mirror_qemu.git/commit
hw/arm/musicpal: Convert to qemu_add_kbd_event_handler()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Nov 2023 18:27:50 +0000 (18:27 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Jan 2024 11:30:47 +0000 (11:30 +0000)
commitff7888dcc6c7011abae67f02279b837a20fdd96f
tree387191310b427ec97e0a8fd2d43df3bc8e2059a6
parent4859da572b41d93339b2dbfc80a70ab9cd9aea7d
hw/arm/musicpal: Convert to qemu_add_kbd_event_handler()

Convert the musicpal key input device to use
qemu_add_kbd_event_handler().  This lets us simplify it because we no
longer need to track whether we're in the middle of a PS/2 multibyte
key sequence.

In the conversion we move the keyboard handler registration from init
to realize, because devices shouldn't disturb the state of the
simulation by doing things like registering input handlers until
they're realized, so that device objects can be introspected
safely.

The behaviour where key-repeat is permitted for the arrow-keys only
is intentional (added in commit 7c6ce4baedfcd0c), so we retain it,
and add a comment to that effect.

This is a migration compatibility break for musicpal.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20231103182750.855577-1-peter.maydell@linaro.org
hw/arm/musicpal.c