static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    KBDState *s = (KBDState *)dev;

    int qcode, keycode;



    qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

    if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    keycode = qcode_to_adb_keycode[qcode];



    if (evt->u.key.data->down == false) { /* if key release event */

        keycode = keycode | 0x80;   /* create keyboard break code */

    }



    adb_kbd_put_keycode(s, keycode);

}

static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    KBDState *s = (KBDState *)dev;

    int qcode, keycode;



    qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

    if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    keycode = qcode_to_adb_keycode[qcode];



    if (evt->u.key.data->down == false) { 

        keycode = keycode | 0x80;   

    }



    adb_kbd_put_keycode(s, keycode);

}

static void FUNC_0(DeviceState *VAR_0, QemuConsole *VAR_1,

                               InputEvent *VAR_2)

{

    KBDState *s = (KBDState *)VAR_0;

    int VAR_3, VAR_4;



    VAR_3 = qemu_input_key_value_to_qcode(VAR_2->u.key.data->key);

    if (VAR_3 >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    VAR_4 = qcode_to_adb_keycode[VAR_3];



    if (VAR_2->u.key.data->down == false) { 

        VAR_4 = VAR_4 | 0x80;   

    }



    adb_kbd_put_keycode(s, VAR_4);

}

static void FUNC_0(DeviceState *VAR_0, QemuConsole *VAR_1,
InputEvent *VAR_2)
{ KBDState *s = (KBDState *)VAR_0; int VAR_3, VAR_4; VAR_3 = qemu_input_key_value_to_qcode(VAR_2->u.key.data->key); if (VAR_3 >= ARRAY_SIZE(qcode_to_adb_keycode)) { return; } VAR_4 = qcode_to_adb_keycode[VAR_3]; if (VAR_2->u.key.data->down == false) { VAR_4 = VAR_4 | 0x80; } adb_kbd_put_keycode(s, VAR_4); }