Reputation: 351
Background/Disclaimer: Im currently working on a C# project that requires interaction with Microsoft's Raw Input API. I am a C# developer and I'm completely new to the Raw Input API 'space' and new to related APIs (i.e. Windows Forms, user32.dll, Windows Programming) in general.
The Question: Due to my background, I prefer to use the Raw Input API through a C# managed wrapper library; I have chosen SharpDX, but I am open to other C# solutions. I've gotten raw input to work, capturing both the keyboard event and a IntPtr representing the keyboard device. Is there a way I can find more information on the device (such as Guid, Product Name, Device Name, etc) with this IntPtr reference?
What has been done so far
Note: Though a code answer is helpful, I'm not here just to "grab-an-answer-and-run". As long as its possible to do this via some C# managed free library or without a C# 'unsafe' context; sending me links to the documentation of said library and to the library's main site with some general guidelines should suffice.
Upvotes: 2
Views: 1644
Reputation: 936
In theory, yes, the pointer should be a reference to the handle of the input device, therefore you should be able to invoke GetRawInputDeviceInfo to get the desired information.
You'll have to either import this external function call yourself (from KMoussa's comment), or in your C# managed wrapper of choice.
Upvotes: 2