HeavenWu / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

DirectInput DeviceType enum usage #802

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there, 

I´m using March 2011 version of SlimDX. This issue is regarding DirectInput.

In the DeviceInstance class, there is a field called "Type", which is a direct 
translation of the native parameter "dwDevType". In the native version, this 
value is a DWORD, which codes several parameters in the different bytes of the 
DWORD. According to MSDN:

"Device type specifier. The least-significant byte of the device type 
description code specifies the device type. The next-significant byte specifies 
the device subtype..."

In SlimDX, you set this field to be of the type "DeviceType", which is an 
enumeration with values like "Mouse, Keyboard, etc".

In fact, only the least significant byte of the original DWORD matches that 
"DeviceType" enum, so I´d suggest you one of the following options:

a- Change the type of the "Type" field, to be an int, so it´s more clear the 
relation with the original "dwDevType" parameter.

b- Leave the data type like it is right now, but take only the least 
significant byte of the original parameter, and properly convert it to the 
"DeviceType" enum.

As long as you already offer the "DeviceSubType" field, maybe the second option 
would be better... 

Thanks, and go on with this awesome work !!!!

Original issue reported on code.google.com by iayucart...@gmail.com on 31 May 2011 at 1:04

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2078.

Original comment by Mike.Popoloski on 9 Jun 2011 at 3:22