https://bugs.winehq.org/show_bug.cgi?id=50506
Bug ID: 50506 Summary: Do not receive WM_INPUT messages for game controllers registered with RegisterRawInputDevices Product: Wine Version: 6.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: blocker Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: lunarlambda@gmail.com Distribution: ---
I am using RegisterRawInputDevices with HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_JOYSTICK, and HID_USAGE_GENERIC_GAMEPAD.
My controller (Nintendo Switch Pro Controller) shows up in joy.cpl, and input works.
The controller shows up in GetRawInputDeviceList, I can query it with GetRawInputDeviceInfo, and opening it and getting the product name via HidD_GetProductString also works.
However, my window simply never receives any WM_INPUT messages.
If I register a keyboard instead (HID_USAGE_GENERIC_KEYBOARD), using the same code, I do get WM_INPUT messages.
I was hopeful that this had been fixed in 6.0, but I was looking through dlls/user32/rawinput.c, but I cannot find anything indicative of a lack of support.
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #1 from lunarlambda@gmail.com --- I think this is where the message is getting dropped, although I cannot get this trace print to trigger to confirm
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/user32/message.c#l282...
https://bugs.winehq.org/show_bug.cgi?id=50506
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
--- Comment #2 from Rémi Bernon rbernon@codeweavers.com --- No, the WM_INPUT messages aren't sent for HID reports, in current Wine (6.0). There's some wine-staging patches that should implement the feature already:
https://github.com/wine-staging/wine-staging/tree/master/patches/user32-rawi...
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #3 from lunarlambda@gmail.com --- (In reply to Rémi Bernon from comment #2)
No, the WM_INPUT messages aren't sent for HID reports, in current Wine (6.0). There's some wine-staging patches that should implement the feature already:
https://github.com/wine-staging/wine-staging/tree/master/patches/user32- rawinput-hid
Thank you for pointing me towards those! Is there active work / discussion around merging these into wine/wine-staging at some point? I'd like to help make it happen, if possible.
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #4 from Rémi Bernon rbernon@codeweavers.com --- I wasn't actively trying to upstream the patches, no, but mostly because there were based upon some similar mouse input patches that required some other outstanding focus bugs to be solved first (see https://bugs.winehq.org/show_bug.cgi?id=2155#c25, for explanation -although the fix is still incorrect I think).
Although the HID rawinput patches would suffer from the same issues described above, it's probably more harmless (and already the case anyway) to have gamepad input be received while in background than it is for mouse or keyboard. The HID patches could probably be re-ordered, and I'll try to see if I can upstream them.
It also probably depends on https://bugs.winehq.org/show_bug.cgi?id=50510, which I'l look at too.
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #5 from Rémi Bernon rbernon@codeweavers.com --- Created attachment 69776 --> https://bugs.winehq.org/attachment.cgi?id=69776 Patch fixing the issue
Attaching an updated patch for Wine 6.6, which I'm also currently trying to upstream, and which supersedes the current user32-rawinput-hid wine-staging patch. This should be applied first, the mouse rawinput patch series now depends on it.
https://bugs.winehq.org/show_bug.cgi?id=50506
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/user32-rawinput- | |hid Summary|Do not receive WM_INPUT |WM_INPUT messages are not |messages for game |received for HID devices |controllers registered with |registered with |RegisterRawInputDevices |RegisterRawInputDevices Status|UNCONFIRMED |STAGED Ever confirmed|0 |1 CC| |z.figura12@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=50506
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #6 from winetest@luukku.com --- at least some code was merged. is there still some known issues left?
https://bugs.winehq.org/show_bug.cgi?id=50506
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #69776|0 |1 is obsolete| |
--- Comment #7 from Rémi Bernon rbernon@codeweavers.com --- Created attachment 70032 --> https://bugs.winehq.org/attachment.cgi?id=70032 Patch fixing the issue
This is the latest version of the series, which I sent upstream as 205840-205843 but didn't make it.
https://bugs.winehq.org/show_bug.cgi?id=50506
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fgouget@codeweavers.com Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=50506
Julian Rüger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #8 from Rémi Bernon rbernon@codeweavers.com --- This should be fixed after fc64aa7e7cdf715738ed411afb4da69064939a2b
https://bugs.winehq.org/show_bug.cgi?id=50506
--- Comment #9 from winetest@luukku.com --- (In reply to Rémi Bernon from comment #8)
This should be fixed after fc64aa7e7cdf715738ed411afb4da69064939a2b
shouldn't this marked fixed? the staging link no longer works.
https://bugs.winehq.org/show_bug.cgi?id=50506
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |fc64aa7e7cdf715738ed411afb4 | |da69064939a2b
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- (In reply to winetest from comment #9)
(In reply to Rémi Bernon from comment #8)
This should be fixed after fc64aa7e7cdf715738ed411afb4da69064939a2b
shouldn't this marked fixed? the staging link no longer works.
Ideally the initial reporter should retest, but I'll go ahead and mark this fixed.
https://bugs.winehq.org/show_bug.cgi?id=50506
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.12.