Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
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