ui/vc: rename kbd_put to qemu_text_console functions
They are QemuTextConsole functions, let's make it clear. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
f5360a0d28
commit
cc6ba2c6f5
@ -112,9 +112,9 @@ bool qemu_mouse_set(int index, Error **errp);
|
||||
#define QEMU_KEY_CTRL_PAGEUP 0xe406
|
||||
#define QEMU_KEY_CTRL_PAGEDOWN 0xe407
|
||||
|
||||
void kbd_put_keysym_console(QemuTextConsole *s, int keysym);
|
||||
bool kbd_put_qcode_console(QemuTextConsole *s, int qcode, bool ctrl);
|
||||
void kbd_put_string_console(QemuTextConsole *s, const char *str, int len);
|
||||
void qemu_text_console_put_keysym(QemuTextConsole *s, int keysym);
|
||||
bool qemu_text_console_put_qcode(QemuTextConsole *s, int qcode, bool ctrl);
|
||||
void qemu_text_console_put_string(QemuTextConsole *s, const char *str, int len);
|
||||
|
||||
/* Touch devices */
|
||||
typedef struct touch_slot {
|
||||
|
@ -784,7 +784,7 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven
|
||||
}
|
||||
|
||||
if (keysym) {
|
||||
kbd_put_keysym_console(NULL, keysym);
|
||||
qemu_text_console_put_keysym(NULL, keysym);
|
||||
}
|
||||
}
|
||||
|
||||
|
10
ui/console.c
10
ui/console.c
@ -1135,7 +1135,7 @@ static void kbd_send_chars(QemuTextConsole *s)
|
||||
}
|
||||
|
||||
/* called when an ascii key is pressed */
|
||||
void kbd_put_keysym_console(QemuTextConsole *s, int keysym)
|
||||
void qemu_text_console_put_keysym(QemuTextConsole *s, int keysym)
|
||||
{
|
||||
uint8_t buf[16], *q;
|
||||
int c;
|
||||
@ -1217,7 +1217,7 @@ static const int ctrl_qcode_to_keysym[Q_KEY_CODE__MAX] = {
|
||||
[Q_KEY_CODE_PGDN] = QEMU_KEY_CTRL_PAGEDOWN,
|
||||
};
|
||||
|
||||
bool kbd_put_qcode_console(QemuTextConsole *s, int qcode, bool ctrl)
|
||||
bool qemu_text_console_put_qcode(QemuTextConsole *s, int qcode, bool ctrl)
|
||||
{
|
||||
int keysym;
|
||||
|
||||
@ -1225,16 +1225,16 @@ bool kbd_put_qcode_console(QemuTextConsole *s, int qcode, bool ctrl)
|
||||
if (keysym == 0) {
|
||||
return false;
|
||||
}
|
||||
kbd_put_keysym_console(s, keysym);
|
||||
qemu_text_console_put_keysym(s, keysym);
|
||||
return true;
|
||||
}
|
||||
|
||||
void kbd_put_string_console(QemuTextConsole *s, const char *str, int len)
|
||||
void qemu_text_console_put_string(QemuTextConsole *s, const char *str, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len && str[i]; i++) {
|
||||
kbd_put_keysym_console(s, str[i]);
|
||||
qemu_text_console_put_keysym(s, str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ static void curses_refresh(DisplayChangeListener *dcl)
|
||||
if (keysym == -1)
|
||||
keysym = chr;
|
||||
|
||||
kbd_put_keysym_console(NULL, keysym);
|
||||
qemu_text_console_put_keysym(NULL, keysym);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
6
ui/gtk.c
6
ui/gtk.c
@ -1190,12 +1190,12 @@ static gboolean gd_text_key_down(GtkWidget *widget,
|
||||
QemuTextConsole *con = QEMU_TEXT_CONSOLE(vc->gfx.dcl.con);
|
||||
|
||||
if (key->keyval == GDK_KEY_Delete) {
|
||||
kbd_put_qcode_console(con, Q_KEY_CODE_DELETE, false);
|
||||
qemu_text_console_put_qcode(con, Q_KEY_CODE_DELETE, false);
|
||||
} else if (key->length) {
|
||||
kbd_put_string_console(con, key->string, key->length);
|
||||
qemu_text_console_put_string(con, key->string, key->length);
|
||||
} else {
|
||||
int qcode = gd_map_keycode(gd_get_keycode(key));
|
||||
kbd_put_qcode_console(con, qcode, false);
|
||||
qemu_text_console_put_qcode(con, qcode, false);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -49,10 +49,10 @@ void sdl2_process_key(struct sdl2_console *scon,
|
||||
if (ev->type == SDL_KEYDOWN) {
|
||||
switch (qcode) {
|
||||
case Q_KEY_CODE_RET:
|
||||
kbd_put_keysym_console(s, '\n');
|
||||
qemu_text_console_put_keysym(s, '\n');
|
||||
break;
|
||||
default:
|
||||
kbd_put_qcode_console(s, qcode, ctrl);
|
||||
qemu_text_console_put_qcode(s, qcode, ctrl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ static void handle_textinput(SDL_Event *ev)
|
||||
}
|
||||
|
||||
if (QEMU_IS_TEXT_CONSOLE(con)) {
|
||||
kbd_put_string_console(QEMU_TEXT_CONSOLE(con), ev->text.text, strlen(ev->text.text));
|
||||
qemu_text_console_put_string(QEMU_TEXT_CONSOLE(con), ev->text.text, strlen(ev->text.text));
|
||||
}
|
||||
}
|
||||
|
||||
|
54
ui/vnc.c
54
ui/vnc.c
@ -1945,88 +1945,88 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym)
|
||||
case 0xb8: /* Right ALT */
|
||||
break;
|
||||
case 0xc8:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_UP);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_UP);
|
||||
break;
|
||||
case 0xd0:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_DOWN);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_DOWN);
|
||||
break;
|
||||
case 0xcb:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_LEFT);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_LEFT);
|
||||
break;
|
||||
case 0xcd:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_RIGHT);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_RIGHT);
|
||||
break;
|
||||
case 0xd3:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_DELETE);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_DELETE);
|
||||
break;
|
||||
case 0xc7:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_HOME);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_HOME);
|
||||
break;
|
||||
case 0xcf:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_END);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_END);
|
||||
break;
|
||||
case 0xc9:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_PAGEUP);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_PAGEUP);
|
||||
break;
|
||||
case 0xd1:
|
||||
kbd_put_keysym_console(NULL, QEMU_KEY_PAGEDOWN);
|
||||
qemu_text_console_put_keysym(NULL, QEMU_KEY_PAGEDOWN);
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
kbd_put_keysym_console(NULL, numlock ? '7' : QEMU_KEY_HOME);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '7' : QEMU_KEY_HOME);
|
||||
break;
|
||||
case 0x48:
|
||||
kbd_put_keysym_console(NULL, numlock ? '8' : QEMU_KEY_UP);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '8' : QEMU_KEY_UP);
|
||||
break;
|
||||
case 0x49:
|
||||
kbd_put_keysym_console(NULL, numlock ? '9' : QEMU_KEY_PAGEUP);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '9' : QEMU_KEY_PAGEUP);
|
||||
break;
|
||||
case 0x4b:
|
||||
kbd_put_keysym_console(NULL, numlock ? '4' : QEMU_KEY_LEFT);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '4' : QEMU_KEY_LEFT);
|
||||
break;
|
||||
case 0x4c:
|
||||
kbd_put_keysym_console(NULL, '5');
|
||||
qemu_text_console_put_keysym(NULL, '5');
|
||||
break;
|
||||
case 0x4d:
|
||||
kbd_put_keysym_console(NULL, numlock ? '6' : QEMU_KEY_RIGHT);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '6' : QEMU_KEY_RIGHT);
|
||||
break;
|
||||
case 0x4f:
|
||||
kbd_put_keysym_console(NULL, numlock ? '1' : QEMU_KEY_END);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '1' : QEMU_KEY_END);
|
||||
break;
|
||||
case 0x50:
|
||||
kbd_put_keysym_console(NULL, numlock ? '2' : QEMU_KEY_DOWN);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '2' : QEMU_KEY_DOWN);
|
||||
break;
|
||||
case 0x51:
|
||||
kbd_put_keysym_console(NULL, numlock ? '3' : QEMU_KEY_PAGEDOWN);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '3' : QEMU_KEY_PAGEDOWN);
|
||||
break;
|
||||
case 0x52:
|
||||
kbd_put_keysym_console(NULL, '0');
|
||||
qemu_text_console_put_keysym(NULL, '0');
|
||||
break;
|
||||
case 0x53:
|
||||
kbd_put_keysym_console(NULL, numlock ? '.' : QEMU_KEY_DELETE);
|
||||
qemu_text_console_put_keysym(NULL, numlock ? '.' : QEMU_KEY_DELETE);
|
||||
break;
|
||||
|
||||
case 0xb5:
|
||||
kbd_put_keysym_console(NULL, '/');
|
||||
qemu_text_console_put_keysym(NULL, '/');
|
||||
break;
|
||||
case 0x37:
|
||||
kbd_put_keysym_console(NULL, '*');
|
||||
qemu_text_console_put_keysym(NULL, '*');
|
||||
break;
|
||||
case 0x4a:
|
||||
kbd_put_keysym_console(NULL, '-');
|
||||
qemu_text_console_put_keysym(NULL, '-');
|
||||
break;
|
||||
case 0x4e:
|
||||
kbd_put_keysym_console(NULL, '+');
|
||||
qemu_text_console_put_keysym(NULL, '+');
|
||||
break;
|
||||
case 0x9c:
|
||||
kbd_put_keysym_console(NULL, '\n');
|
||||
qemu_text_console_put_keysym(NULL, '\n');
|
||||
break;
|
||||
|
||||
default:
|
||||
if (control) {
|
||||
kbd_put_keysym_console(NULL, sym & 0x1f);
|
||||
qemu_text_console_put_keysym(NULL, sym & 0x1f);
|
||||
} else {
|
||||
kbd_put_keysym_console(NULL, sym);
|
||||
qemu_text_console_put_keysym(NULL, sym);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user