Repository: libsdl-org/SDL
File: src/core/linux/SDL_evdev.c (C)

Code before:
    return count;
}

void SDL_EVDEV_Poll(void)
{
    struct input_event events[32];
    int i, j, len;
    SDL_evdevlist_item *item;
    SDL_Scancode scancode;
    int mouse_button;
    SDL_Mouse *mouse;
    float norm_x, norm_y, norm_pressure;

    if (!_this) {
        return;
    }

    SDL_EVDEV_kbd_update(_this->kbd);

    mouse = SDL_GetMouse();

    for (item = _this->first; item; item = item->next) {
        while ((len = read(item->fd, events, sizeof(events))) > 0) {
#ifdef SDL_INPUT_FBSDKBIO
            if (SDL_GetAtomicInt(&vt_current) == VT_THEIRS)
                continue;
#endif
            len /= sizeof(events[0]);
            for (i = 0; i < len; ++i) {
                struct input_event *event = &events[i];

                /* special handling for touchscreen, that should eventually be
                   used for all devices */
                if (item->out_of_sync && item->is_touchscreen &&
                    event->type == EV_SYN && event->code != SYN_REPORT) {
                    break;
                }

                switch (event->type) {
                case EV_KEY:
                    if (event->code >= BTN_MOUSE && event->code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {
                        Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
                        mouse_button = event->code - BTN_MOUSE;
                        SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));
                        break;
                    }

                    /* BTN_TOUCH event value 1 indicates there is contact with
                       a touchscreen or trackpad (earliest finger's current
                       position is sent in EV_ABS ABS_X/ABS_Y, switching to
                       next finger after earliest is released) */

Review comment (suggestion):
```suggestion
            if (SDL_GetAtomicInt(&vt_current) == VT_THEIRS) {
                continue;
            }
```

Code after:
    return count;
}

void SDL_EVDEV_Poll(void)
{
    struct input_event events[32];
    int i, j, len;
    SDL_evdevlist_item *item;
    SDL_Scancode scancode;
    int mouse_button;
    SDL_Mouse *mouse;
    float norm_x, norm_y, norm_pressure;

    if (!_this) {
        return;
    }

    SDL_EVDEV_kbd_update(_this->kbd);

    mouse = SDL_GetMouse();

    for (item = _this->first; item; item = item->next) {
        while ((len = read(item->fd, events, sizeof(events))) > 0) {
#ifdef SDL_INPUT_FBSDKBIO
            if (SDL_GetAtomicInt(&vt_current) == VT_THEIRS) {
                continue;
            }
#endif
            len /= sizeof(events[0]);
            for (i = 0; i < len; ++i) {
                struct input_event *event = &events[i];

                /* special handling for touchscreen, that should eventually be
                   used for all devices */
                if (item->out_of_sync && item->is_touchscreen &&
                    event->type == EV_SYN && event->code != SYN_REPORT) {
                    break;
                }

                switch (event->type) {
                case EV_KEY:
                    if (event->code >= BTN_MOUSE && event->code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {
                        Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
                        mouse_button = event->code - BTN_MOUSE;
                        SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));
                        break;
                    }

                    /* BTN_TOUCH event value 1 indicates there is contact with
                       a touchscreen or trackpad (earliest finger's current
                       position is sent in EV_ABS ABS_X/ABS_Y, switching to