summary refs log tree commit diff stats
path: root/include/hw/input
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-10-30 11:48:02 +0000
committerPeter Maydell <peter.maydell@linaro.org>2023-11-02 12:52:06 +0000
commit7c76f397fde313bcdfd3781d64fc28dae0e42df8 (patch)
tree65c4871d09fd2ba9e694e2b0298ae5e49e08fe1b /include/hw/input
parenta75f336b97a643fc536ba847042f840890e9b378 (diff)
downloadfocaccia-qemu-7c76f397fde313bcdfd3781d64fc28dae0e42df8.tar.gz
focaccia-qemu-7c76f397fde313bcdfd3781d64fc28dae0e42df8.zip
hw/input/stellaris_gamepad: Convert to qemu_input_handler_register()
Now that we have converted to qdev, we can use the newer
qemu_input_handler_register() API rather than the legacy
qemu_add_kbd_event_handler().

Since we only have one user, take the opportunity to convert
from scancodes to QCodes, rather than using
qemu_input_key_value_to_scancode() (which adds an 0xe0
prefix and encodes up/down indication in the scancode,
which our old handler function then had to reverse). That
lets us drop the old state field which was tracking whether
we were halfway through a two-byte scancode.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231030114802.3671871-7-peter.maydell@linaro.org
Diffstat (limited to 'include/hw/input')
-rw-r--r--include/hw/input/stellaris_gamepad.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/input/stellaris_gamepad.h b/include/hw/input/stellaris_gamepad.h
index d6a6aecb06..51085e166c 100644
--- a/include/hw/input/stellaris_gamepad.h
+++ b/include/hw/input/stellaris_gamepad.h
@@ -17,6 +17,7 @@
 /*
  * QEMU interface:
  *  + QOM array property "keycodes": uint32_t QEMU keycodes to handle
+ *    (these are QCodes, ie the Q_KEY_* values)
  *  + unnamed GPIO outputs: one per keycode, in the same order as the
  *    "keycodes" array property entries; asserted when key is down
  */
@@ -31,7 +32,6 @@ struct StellarisGamepad {
     qemu_irq *irqs;
     uint32_t *keycodes;
     uint8_t *pressed;
-    int extension;
 };
 
 #endif