[PATCH 4/4] dinput: Implement DIPROP_APPDATA.

Arkadiusz Hiler ahiler at codeweavers.com
Wed May 26 06:36:11 CDT 2021


On Tue, May 25, 2021 at 11:30:50PM +0300, Arkadiusz Hiler wrote:
> On Tue, May 25, 2021 at 09:41:12PM +0200, Rémi Bernon wrote:
> > On 5/25/21 9:21 PM, Francois Gouget wrote:
> > > Hi,
> > > 
> > > On Mon, 8 Mar 2021, Arkadiusz Hiler wrote:
> > > 
> > > > This fixes not working analog inputs on game controllers in Slay the Spire.
> > > > 
> > > > Signed-off-by: Arkadiusz Hiler <ahiler at codeweavers.com>
> > > 
> > > This commit is causing a new failure on w10pro64-fr, and only on that
> > > machine:
> > > https://bugs.winehq.org//show_bug.cgi?id=50987
> > > 
> > > Do you have any insight or even a fix for it?
> > > 
> > > 
> > 
> > As it's on fr windows and the test registers DIK_A / sends 'A' key event,
> > I'd say it's most likely related to the layout.
> > 
> > I noticed there's some other dinput test which fails, on Wine, because of
> > French layout too [1].

https://testbot.winehq.org/JobDetails.pl?Key=91255&f202=exe32.report&f401=win32_fr_FR.report#k202

This one looks like an actual bug/missing feature. The test is keyboard
layout aware and tests the French mapping explicitly.

'keyboard.c:53: Loading keyboard layout 0000040c'

So we think that we have a standard French layout.

The culprit is the following call:
MapVirtualKeyExA(vkey, MAPVK_VK_TO_VSC, hkl);

On FR Wine:
keyboard.c:422: vkey 41 mapped to scan 1e
'A' maps to scancode for 'A'

On FR Windows:
keyboard.c:422: vkey 41 mapped to scan 10
'A' maps to scancode for 'Q'

On Linux/X11 MapVirtualKeyEx implementation is backed by
X11Drv_MapVirtualKeyEx[0] and there's something off with either locale
matching or code that populates keyc2vkey.

[0]: https://source.winehq.org/git/wine.git/blob/refs/heads/master:/dlls/winex11.drv/keyboard.c#l1983

Cheers,
Arek

> > I think it's going to be hard to write tests robust enough to pass with all
> > the possible layouts, and if the tests aren't meant to validate some
> > localization aspect, they could perhaps be skipped on non-US locales.
> > 
> > [1] https://test.winehq.org/data/dff85646517526562644c23648d11596daeb26d0/linux_fg-deb64-t32/dinput:keyboard.html
> 
> Yep, it's because AZERTY is a thing + the test code I've extended is not
> layout aware.
> 
> The simple hack to make the test pass would be to pick up a different
> letter than the unfortunate A, but Rémi is right... This may cause more
> problems in the long run and we either need to make those layout aware
> or we should start skipping a bunch of fake input tests on non-US
> locale.
> 
> I'll look into that. Thanks!
> 
> -- 
> Cheers,
> Arek
> 



More information about the wine-devel mailing list