static void do_send_key(const char *string)

{

    char keybuf[16], *q;

    uint8_t keycodes[16];

    const char *p;

    int nb_keycodes, keycode, i;



    nb_keycodes = 0;

    p = string;

    while (*p != '\0') {

        q = keybuf;

        while (*p != '\0' && *p != '-') {

            if ((q - keybuf) < sizeof(keybuf) - 1) {

                *q++ = *p;

            }

            p++;

        }

        *q = '\0';

        keycode = get_keycode(keybuf);

        if (keycode < 0) {

            term_printf("unknown key: '%s'\n", keybuf);

            return;

        }

        keycodes[nb_keycodes++] = keycode;

        if (*p == '\0')

            break;

        p++;

    }

    /* key down events */

    for(i = 0; i < nb_keycodes; i++) {

        keycode = keycodes[i];

        if (keycode & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(keycode & 0x7f);

    }

    /* key up events */

    for(i = nb_keycodes - 1; i >= 0; i--) {

        keycode = keycodes[i];

        if (keycode & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(keycode | 0x80);

    }

}

static void do_send_key(const char *string)

{

    char keybuf[16], *q;

    uint8_t keycodes[16];

    const char *p;

    int nb_keycodes, keycode, i;



    nb_keycodes = 0;

    p = string;

    while (*p != '\0') {

        q = keybuf;

        while (*p != '\0' && *p != '-') {

            if ((q - keybuf) < sizeof(keybuf) - 1) {

                *q++ = *p;

            }

            p++;

        }

        *q = '\0';

        keycode = get_keycode(keybuf);

        if (keycode < 0) {

            term_printf("unknown key: '%s'\n", keybuf);

            return;

        }

        keycodes[nb_keycodes++] = keycode;

        if (*p == '\0')

            break;

        p++;

    }

    

    for(i = 0; i < nb_keycodes; i++) {

        keycode = keycodes[i];

        if (keycode & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(keycode & 0x7f);

    }

    

    for(i = nb_keycodes - 1; i >= 0; i--) {

        keycode = keycodes[i];

        if (keycode & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(keycode | 0x80);

    }

}

static void do_send_key(const char *string)     char keybuf[16], *q;     const char *p;     int nb_keycodes, keycode, i;     nb_keycodes = 0;     p = string;     while (*p != '\0') {         q = keybuf;         while (*p != '\0' && *p != '-') {             if ((q - keybuf) < sizeof(keybuf) - 1) {                 *q++ = *p;             p++;         *q = '\0';         keycode = get_keycode(keybuf);         if (keycode < 0) {             term_printf("unknown key: '%s'\n", keybuf);         keycodes[nb_keycodes++] = keycode;         if (*p == '\0')         p++;
static void FUNC_0(const char *VAR_0)

{

    char VAR_1[16], *VAR_2;

    uint8_t keycodes[16];

    const char *VAR_3;

    int VAR_4, VAR_5, VAR_6;



    VAR_4 = 0;

    VAR_3 = VAR_0;

    while (*VAR_3 != '\0') {

        VAR_2 = VAR_1;

        while (*VAR_3 != '\0' && *VAR_3 != '-') {

            if ((VAR_2 - VAR_1) < sizeof(VAR_1) - 1) {

                *VAR_2++ = *VAR_3;

            }

            VAR_3++;

        }

        *VAR_2 = '\0';

        VAR_5 = get_keycode(VAR_1);

        if (VAR_5 < 0) {

            term_printf("unknown key: '%s'\n", VAR_1);

            return;

        }

        keycodes[VAR_4++] = VAR_5;

        if (*VAR_3 == '\0')

            break;

        VAR_3++;

    }

    

    for(VAR_6 = 0; VAR_6 < VAR_4; VAR_6++) {

        VAR_5 = keycodes[VAR_6];

        if (VAR_5 & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(VAR_5 & 0x7f);

    }

    

    for(VAR_6 = VAR_4 - 1; VAR_6 >= 0; VAR_6--) {

        VAR_5 = keycodes[VAR_6];

        if (VAR_5 & 0x80)

            kbd_put_keycode(0xe0);

        kbd_put_keycode(VAR_5 | 0x80);

    }

}

static void FUNC_0(const char *VAR_0)
{ char VAR_1[16], *VAR_2; uint8_t keycodes[16]; const char *VAR_3; int VAR_4, VAR_5, VAR_6; VAR_4 = 0; VAR_3 = VAR_0; while (*VAR_3 != '\0') { VAR_2 = VAR_1; while (*VAR_3 != '\0' && *VAR_3 != '-') { if ((VAR_2 - VAR_1) < sizeof(VAR_1) - 1) { *VAR_2++ = *VAR_3; } VAR_3++; } *VAR_2 = '\0'; VAR_5 = get_keycode(VAR_1); if (VAR_5 < 0) { term_printf("unknown key: '%s'\n", VAR_1); return; } keycodes[VAR_4++] = VAR_5; if (*VAR_3 == '\0')
break; VAR_3++; } for(VAR_6 = 0; VAR_6 < VAR_4; VAR_6++) { VAR_5 = keycodes[VAR_6]; if (VAR_5 & 0x80)
kbd_put_keycode(0xe0); kbd_put_keycode(VAR_5 & 0x7f); } for(VAR_6 = VAR_4 - 1; VAR_6 >= 0; VAR_6--) { VAR_5 = keycodes[VAR_6]; if (VAR_5 & 0x80)
kbd_put_keycode(0xe0); kbd_put_keycode(VAR_5 | 0x80); } }