All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Subject: [GIT PULL 02/27] ui/hmp: move index_from_key() where it is used
Date: Wed, 17 Jun 2026 19:22:59 +0400	[thread overview]
Message-ID: <20260617-ui-input-v1-2-79e9aedc5899@redhat.com> (raw)
In-Reply-To: <20260617-ui-input-v1-0-79e9aedc5899@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/ui/console.h |  3 ---
 ui/input-legacy.c    | 15 ---------------
 ui/ui-hmp-cmds.c     | 15 +++++++++++++++
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index a31c5a4995c..3cb78989cd2 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -450,9 +450,6 @@ bool vnc_display_reload_certs(const char *id,  Error **errp);
 bool vnc_display_update(DisplayUpdateOptionsVNC *arg, Error **errp);
 void vnc_cleanup(void);
 
-/* input.c */
-int index_from_key(const char *key, size_t key_length);
-
 #ifdef CONFIG_LINUX
 /* udmabuf.c */
 int udmabuf_fd(void);
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 193c9ae2ef9..71b17a3cfc7 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -56,21 +56,6 @@ struct QEMUPutLEDEntry {
 static QTAILQ_HEAD(, QEMUPutLEDEntry) led_handlers =
     QTAILQ_HEAD_INITIALIZER(led_handlers);
 
-int index_from_key(const char *key, size_t key_length)
-{
-    int i;
-
-    for (i = 0; i < Q_KEY_CODE__MAX; i++) {
-        if (!strncmp(key, QKeyCode_str(i), key_length) &&
-            !QKeyCode_str(i)[key_length]) {
-            break;
-        }
-    }
-
-    /* Return Q_KEY_CODE__MAX if the key is invalid */
-    return i;
-}
-
 void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time,
                   Error **errp)
 {
diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c
index 1e9bc77bd80..76f5181de43 100644
--- a/ui/ui-hmp-cmds.c
+++ b/ui/ui-hmp-cmds.c
@@ -350,6 +350,21 @@ void hmp_change_vnc(Monitor *mon, const char *device, const char *target,
 }
 #endif
 
+static int index_from_key(const char *key, size_t key_length)
+{
+    int i;
+
+    for (i = 0; i < Q_KEY_CODE__MAX; i++) {
+        if (!strncmp(key, QKeyCode_str(i), key_length) &&
+            !QKeyCode_str(i)[key_length]) {
+            break;
+        }
+    }
+
+    /* Return Q_KEY_CODE__MAX if the key is invalid */
+    return i;
+}
+
 void hmp_sendkey(Monitor *mon, const QDict *qdict)
 {
     const char *keys = qdict_get_str(qdict, "keys");

-- 
2.54.0



  parent reply	other threads:[~2026-06-17 15:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 15:22 [GIT PULL 00/27] UI patches for 2026-06-17 Marc-André Lureau
2026-06-17 15:22 ` [GIT PULL 01/27] hmp-commands.hx: fix button_state doc Marc-André Lureau
2026-06-17 15:22 ` Marc-André Lureau [this message]
2026-06-17 15:23 ` [GIT PULL 03/27] hw/i386/vmmouse: convert to QemuInputHandler API Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 04/27] hw/usb/dev-wacom: convert to modern " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 05/27] ui: move LED and key utilities to input.c, delete input-legacy.c Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 06/27] hw/input: replace fprint with LOG_GUEST_ERROR Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 07/27] ui/input: remove double-notification on qemu_mouse_set() Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 08/27] ui/input: remove dead declaration Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 09/27] ui/input: add LED state tracking to QemuInputHandlerState Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 10/27] hw/input/ps2: keep QemuInputHandlerState in PS2State Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 11/27] hw/arm: keep QemuInputHandlerState in musicpal Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 12/27] hw/input: keep QemuInputHandlerState in adb-kbd Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 13/27] hw/input: keep QemuInputHandlerState in stellaris Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 14/27] hw/m68k: keep QemuInputHandlerState in next-kbd Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 15/27] ui/input: qemu_input_handler_register to warn for unused result Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 16/27] hw/input/ps2: use qemu_input_handler_set_leds_mask() for LED state Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 17/27] hw/input/hid: " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 18/27] hw/input/virtio-input-hid: " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 19/27] ui/vnc: switch LED handling to Notifier-based input API Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 20/27] ui/spice: " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 21/27] ui/dbus: " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 22/27] ui/input: remove old LED handler broadcast queue Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 23/27] tools/qemu-vnc: Have console_get_mouse/keyboard take const QemuConsole Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 24/27] ui/input: Have qemu_input_is_absolute() take a " Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 25/27] ui/pixman: fix zero rowstride in qemu_pixman_image_new_shareable() Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 26/27] ui/sdl2: Explicitly specify EGL platform Marc-André Lureau
2026-06-17 15:23 ` [GIT PULL 27/27] ui/sdl2: Set GL ES profile before creating initial GL context Marc-André Lureau
2026-06-18 17:53 ` [GIT PULL 00/27] UI patches for 2026-06-17 Stefan Hajnoczi

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=20260617-ui-input-v1-2-79e9aedc5899@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.