/* keycode is expressed as follow: bit 7 - 0 key pressed, 1 = key released bits 6-0 - translated scancode set 2  */
static void ps2_put_keycode(void *opaque, int keycode)
/* keycode is expressed as follow: bit 7 - 0 key pressed, 1 = key released bits 6-0 - translated scancode set 2  */
static void ps2_put_keycode(void *opaque, int keycode)
{
    PS2KbdState *s = opaque;
    qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER);
    if (!s->translate && keycode < 0xe0 && s->scancode_set > 1) {
        if (keycode & 0x80) {
            ps2_queue(&s->common, 0xf0);
        }
        if (s->scancode_set == 2) {
            keycode = ps2_raw_keycode[keycode & 0x7f];
        } else if (s->scancode_set == 3) {
            keycode = ps2_raw_keycode_set3[keycode & 0x7f];
        }
      }
    ps2_queue(&s->common, keycode);
}