Vincent Pelletier wrote:
joydevs[id].name value comes from EVIOCGNAME iotcl, and is the product name.
I think joystick device path qualifies as a "Friendly name for the instance" (as defined for tszInstanceName on MSDN).
If not, please tell me and I will extend the patch to generate a "Joystick %i" name, or maybe put joydevs[id].name in both fields.
- strcpy(lpddi->tszInstanceName, joydevs[id].name);
- strcpy(lpddi->tszProductName, joydevs[id].device);
- strcpy(lpddi->tszInstanceName, joydevs[id].device);
- strcpy(lpddi->tszProductName, joydevs[id].name);
No this is not entirely correct. Native doesn't return any device paths. But it does return proper joystick name:
Wine: Instance: Logitech Logitech Dual Action ProductName: /dev/input/event7
Win XP: Instance: Logitech Dual Action USB ProductName: Logitech Dual Action USB
Another joystick: Wine: Instance: Logitech Logitech MOMO Racing ProductName: /dev/input/event7
Win XP: Instance: Logitech MOMO Racing USB ProductName: Logitech MOMO Racing USB
So I'd suggest copying name into both places. I think some applications looking for particular information there. And append "evdev?" at the end so we can tell how it's handled.
Vitaliy.
Le Saturday 07 February 2009 19:25:56 Vitaliy Margolen, vous avez écrit :
So I'd suggest copying name into both places.
Ok.
And append "evdev?" at the end so we can tell how it's handled.
See attached patch. First version I locally wrote only stored an additional int in joydev, but: - maybe it's not a good idea to compute the concatenation on each fill_joystick_dideviceinstance[AW] call - ...I just don't know how to append to a widechar string (MSDN list of widechar funcs)
Vincent Pelletier wrote:
Le Saturday 07 February 2009 19:25:56 Vitaliy Margolen, vous avez écrit :
So I'd suggest copying name into both places.
Ok.
And append "evdev?" at the end so we can tell how it's handled.
See attached patch. First version I locally wrote only stored an additional int in joydev, but:
- maybe it's not a good idea to compute the concatenation on each fill_joystick_dideviceinstance[AW] call
- ...I just don't know how to append to a widechar string (MSDN list of
widechar funcs)
Sorry didn't reply earlier - no this is not what I meant. Native returns the same string for both. So just drop the device path all together. Make it the name returned from the kernel + "evdev%d" ala "USB" native adds.
Vitaliy.
2009/2/10 Vincent Pelletier plr.vincent@gmail.com:
On Tue, Feb 10, 2009 at 1:00 AM, Ben Klein shacklein@gmail.com wrote:
You're adding a new field to the JoyDev struct called instance_name, which if I read right will store the input device path, but what happens to the existing device field? It looks like it's just taking up space, not actually getting a value stored in it.
There is a value stored in it: see the code just above the second chunk in my patch.
You're taking out the strcpy into device, and replacing it with a strcpy into instance_name. What value will the device field hold?
But maybe you mean that it might not be read any more... Which might be the case, I didn't check.
About using space, I was more "worried" about the duplication of data between "name" (kernel-provided device string - not a path) and the new "instance_name" (could not find a better name for that without changing existing) which also contains the device string plus "evdev%d" as Vitaliy proposed.
When will the new "instance_name" field be accessed by Wine? Regarding Vitaliy's earlier post, it looks ike "name" (product name) and "instance_name" are the same on native Windows platform. If this is always true, returning "name" when asked for instance name would be valid (so, storing only one string). A counter-example of this would be useful.
The other difference is that the evdev method returns the vendor as a part of the product name (hence "Logitech Logitech MOMO Racing" etc.) Should we be concerned about this?