static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
{
    VirtualConsole *vc = opaque;
    GtkDisplayState *s = vc->s;
    int gdk_keycode = key->hardware_keycode;
    int qemu_keycode;
    int i;
    if (key->keyval == GDK_KEY_Pause) {
        qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
                                        key->type == GDK_KEY_PRESS);
    qemu_keycode = gd_map_keycode(s, gtk_widget_get_display(widget),
                                  gdk_keycode);
    trace_gd_key_event(vc->label, gdk_keycode, qemu_keycode,
                       (key->type == GDK_KEY_PRESS) ? "down" : "up");
    for (i = 0; i < ARRAY_SIZE(modifier_keycode); i++) {
        if (qemu_keycode == modifier_keycode[i]) {
            s->modifier_pressed[i] = (key->type == GDK_KEY_PRESS);
    qemu_input_event_send_key_number(vc->gfx.dcl.con, qemu_keycode,
                                     key->type == GDK_KEY_PRESS);
static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
{
    VirtualConsole *vc = opaque;
    GtkDisplayState *s = vc->s;
    int gdk_keycode = key->hardware_keycode;
    int qemu_keycode;
    int i;
    if (key->keyval == GDK_KEY_Pause) {
        qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
                                        key->type == GDK_KEY_PRESS);
    qemu_keycode = gd_map_keycode(s, gtk_widget_get_display(widget),
                                  gdk_keycode);
    trace_gd_key_event(vc->label, gdk_keycode, qemu_keycode,
                       (key->type == GDK_KEY_PRESS) ? "down" : "up");
    for (i = 0; i < ARRAY_SIZE(modifier_keycode); i++) {
        if (qemu_keycode == modifier_keycode[i]) {
            s->modifier_pressed[i] = (key->type == GDK_KEY_PRESS);
    qemu_input_event_send_key_number(vc->gfx.dcl.con, qemu_keycode,
                                     key->type == GDK_KEY_PRESS);
static gboolean FUNC_0(GtkWidget *widget, GdkEventKey *key, void *opaque)
{
    VirtualConsole *vc = opaque;
    GtkDisplayState *s = vc->s;
    int VAR_0 = key->hardware_keycode;
    int VAR_1;
    int VAR_2;
    if (key->keyval == GDK_KEY_Pause) {
        qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
                                        key->type == GDK_KEY_PRESS);
    VAR_1 = gd_map_keycode(s, gtk_widget_get_display(widget),
                                  VAR_0);
    trace_gd_key_event(vc->label, VAR_0, VAR_1,
                       (key->type == GDK_KEY_PRESS) ? "down" : "up");
    for (VAR_2 = 0; VAR_2 < ARRAY_SIZE(modifier_keycode); VAR_2++) {
        if (VAR_1 == modifier_keycode[VAR_2]) {
            s->modifier_pressed[VAR_2] = (key->type == GDK_KEY_PRESS);
    qemu_input_event_send_key_number(vc->gfx.dcl.con, VAR_1,
                                     key->type == GDK_KEY_PRESS);
static gboolean FUNC_0(GtkWidget *widget, GdkEventKey *key, void *opaque)
{ VirtualConsole *vc = opaque; GtkDisplayState *s = vc->s; int VAR_0 = key->hardware_keycode; int VAR_1; int VAR_2; if (key->keyval == GDK_KEY_Pause) { qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
key->type == GDK_KEY_PRESS); VAR_1 = gd_map_keycode(s, gtk_widget_get_display(widget),
VAR_0); trace_gd_key_event(vc->label, VAR_0, VAR_1,
(key->type == GDK_KEY_PRESS) ? "down" : "up"); for (VAR_2 = 0; VAR_2 < ARRAY_SIZE(modifier_keycode); VAR_2++) { if (VAR_1 == modifier_keycode[VAR_2]) { s->modifier_pressed[VAR_2] = (key->type == GDK_KEY_PRESS); qemu_input_event_send_key_number(vc->gfx.dcl.con, VAR_1,
key->type == GDK_KEY_PRESS);