dinput: Convert keyboard buffer from internal data format to user data format

Vitaliy Margolen wine-devel at kievinfo.com
Wed May 14 20:32:33 CDT 2008


Sergey Khodych wrote:
>> To reply to myself. I've missed the fact that if the requested format 
>> is the
>> same as Wine's internal format it will be a simple memcpy. I did not 
>> want to
>> penalize most dinput applications that just use default keyboard 
>> format (array
>> of 256 bytes).
>>
> What do you think about using common buffer for all types of devices and 
> translating a new event direct to user's data format? In this case we 
> just copy buffer of base device.

It's hard to find something common for say keyboard and joystick. Former 
have lots of only buttons while later can have lots of axes and only few 
buttons. So still have to use some specialized data buffer.

Or you mean to use user data format internally? That will still require some 
mapping - from indexes to offset & size. But that gets really messy and 
still requires conversion (which we are doing anyway). Unless everything 
will be changed in one go. However when I'm thinking about it - it will 
require extra work while doing object enumeration.

For a time being (during the code freeze) I'd prefer not to change any core 
functions.

Vitaliy.



More information about the wine-devel mailing list