Rémi Bernon (@rbernon) commented about dlls/winebus.sys/bus_udev.c:
impl->hat_map[i - ABS_HAT0X + 1] = impl->hat_count; }
+ if (test_bit(info.ev, EV_BTN)) + { + if (ioctl(fd, EVIOCGBTNCNT, &button_count)) button_count = 0; + else + { + impl->button_count = button_count; + impl->ev_btn = TRUE; + } + } + + if (!impl->ev_btn) + {
Could we just fill button_map sequentially if EV_BTN/EVIOCGBTNCNT are there? I think this would make the ev_btn flag unnecessary and allow to squash the set_report_from_event cases together. We could/should probably make sure we're not considering the device as a gamepad at the same time, though this might be guaranteed with the next change, which should be reordered first maybe. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9853#note_126441