int keysym2scancode(void *kbd_layout, int keysym)

{

    kbd_layout_t *k = kbd_layout;

    if (keysym < MAX_NORMAL_KEYCODE) {

        if (k->keysym2keycode[keysym] == 0) {

            trace_keymap_unmapped(keysym);

            fprintf(stderr, "Warning: no scancode found for keysym %d\n",

                    keysym);

        }

        return k->keysym2keycode[keysym];

    } else {

        int i;

#ifdef XK_ISO_Left_Tab

        if (keysym == XK_ISO_Left_Tab) {

            keysym = XK_Tab;

        }

#endif

        for (i = 0; i < k->extra_count; i++) {

            if (k->keysym2keycode_extra[i].keysym == keysym) {

                return k->keysym2keycode_extra[i].keycode;

            }

        }

    }

    return 0;

}

int keysym2scancode(void *kbd_layout, int keysym)

{

    kbd_layout_t *k = kbd_layout;

    if (keysym < MAX_NORMAL_KEYCODE) {

        if (k->keysym2keycode[keysym] == 0) {

            trace_keymap_unmapped(keysym);

            fprintf(stderr, "Warning: no scancode found for keysym %d\n",

                    keysym);

        }

        return k->keysym2keycode[keysym];

    } else {

        int i;

#ifdef XK_ISO_Left_Tab

        if (keysym == XK_ISO_Left_Tab) {

            keysym = XK_Tab;

        }

#endif

        for (i = 0; i < k->extra_count; i++) {

            if (k->keysym2keycode_extra[i].keysym == keysym) {

                return k->keysym2keycode_extra[i].keycode;

            }

        }

    }

    return 0;

}

int FUNC_0(void *VAR_0, int VAR_1)

{

    kbd_layout_t *k = VAR_0;

    if (VAR_1 < MAX_NORMAL_KEYCODE) {

        if (k->keysym2keycode[VAR_1] == 0) {

            trace_keymap_unmapped(VAR_1);

            fprintf(stderr, "Warning: no scancode found for VAR_1 %d\n",

                    VAR_1);

        }

        return k->keysym2keycode[VAR_1];

    } else {

        int VAR_2;

#ifdef XK_ISO_Left_Tab

        if (VAR_1 == XK_ISO_Left_Tab) {

            VAR_1 = XK_Tab;

        }

#endif

        for (VAR_2 = 0; VAR_2 < k->extra_count; VAR_2++) {

            if (k->keysym2keycode_extra[VAR_2].VAR_1 == VAR_1) {

                return k->keysym2keycode_extra[VAR_2].keycode;

            }

        }

    }

    return 0;

}

int FUNC_0(void *VAR_0, int VAR_1)
{ kbd_layout_t *k = VAR_0; if (VAR_1 < MAX_NORMAL_KEYCODE) { if (k->keysym2keycode[VAR_1] == 0) { trace_keymap_unmapped(VAR_1); fprintf(stderr, "Warning: no scancode found for VAR_1 %d\n",
VAR_1); } return k->keysym2keycode[VAR_1]; } else { int VAR_2; #ifdef XK_ISO_Left_Tab
if (VAR_1 == XK_ISO_Left_Tab) { VAR_1 = XK_Tab; } #endif
for (VAR_2 = 0; VAR_2 < k->extra_count; VAR_2++) { if (k->keysym2keycode_extra[VAR_2].VAR_1 == VAR_1) { return k->keysym2keycode_extra[VAR_2].keycode; } } } return 0; }