Update CustomDevice.cs
Update CustomDevice.cs

Hi guys,

When a JoystickUpdate comes, the offset included there points to a field in the RawJoystickState struct. Sometimes, it's necessary to find what actual DeviceObjectInstance is related to that update.

For that, it would be necessary to clall GetObjectInfo(offset, PropertyHowType.Byoffset), but GetObjectByInfo is internal in your implementation. You already give access to some overloads of it with GetObjectInfoByName, GetObjectInfoById, and GetObjectInfoByUsage, but it lacks the last one: GetObjectInfoByOffset, which is crucial to do that mapping.

So, to achieve that, I have added the following method:

public DeviceObjectInstance GetObjectInfoByOffset(int offset)
{
return GetObjectInfo(offset, PropertyHowType.Byoffset);
}

Many thanks in advance, and congrats for your great great work.
dazerdude/SharpDX,mrvux/SharpDX,waltdestler/SharpDX,waltdestler/SharpDX,sharpdx/SharpDX,dazerdude/SharpDX,sharpdx/SharpDX,andrewst/SharpDX,waltdestler/SharpDX,waltdestler/SharpDX,dazerdude/SharpDX,andrewst/SharpDX,sharpdx/SharpDX,mrvux/SharpDX,dazerdude/SharpDX,andrewst/SharpDX,mrvux/SharpDX