Potential controller issue fixes - CommandMC/EpicLinux GitHub Wiki
While I have not personally experienced it, a lot of people are having issues getting their controllers to work in certain games.
Recently, Fancy2209#2445 on the Legendary Discord has pointed out the tweaks they had to do to get their controller working. Hopefully this can help some more people.
Open up winecfg (preferably by setting WINEPREFIX/PATH first), add the following library overrides and set them to "Native":
xinput_1_1xinput_1_2xinput_1_3xinput_1_4xinput9_1_0
This should be enough to get most games working. If your controller still does not work, try adding these library overrides as well (again setting them to native):
dinputdinput8
If this does not help either, it would mean that the game you're trying to play does not support your controller. You might be able to get around this by using xboxdrv, see the relevant section on the ArchWiki (you can also follow this Wiki when not using an Arch-based distribution)