console: add kbd_put_string_console
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 27 May 2014 07:32:36 +0000 (09:32 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 2 Jun 2014 14:28:58 +0000 (16:28 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/ui/console.h
ui/console.c

index 4ad16c9e1456c36a6adf7e4ba32fec60744c18d4..edbaa9b4754ede12c4c378e8bdc494e02c6d322b 100644 (file)
@@ -83,6 +83,7 @@ void do_mouse_set(Monitor *mon, const QDict *qdict);
 
 void kbd_put_keysym_console(QemuConsole *s, int keysym);
 bool kbd_put_qcode_console(QemuConsole *s, int qcode);
+void kbd_put_string_console(QemuConsole *s, const char *str, int len);
 void kbd_put_keysym(int keysym);
 
 /* consoles */
index b99312c014f83689523973416086e291e4e8ff97..2ce55a69d090f282405faf15058bb37bb5453b7d 100644 (file)
@@ -1133,6 +1133,15 @@ bool kbd_put_qcode_console(QemuConsole *s, int qcode)
     return true;
 }
 
+void kbd_put_string_console(QemuConsole *s, const char *str, int len)
+{
+    int i;
+
+    for (i = 0; i < len && str[i]; i++) {
+        kbd_put_keysym_console(s, str[i]);
+    }
+}
+
 void kbd_put_keysym(int keysym)
 {
     kbd_put_keysym_console(active_console, keysym);