# DirectInput HID device access read.

## Recommended Posts

Hey all, I hope this is the right place to post this. So I acquired some wireless buzz controllers that were originally intended to plug into a PS3 (http://www.buzzthegame.com/assets/img/temp/newFeatures03.png). They came with a USB Dongle and my Windows XP (x86) machine recognized it immediately after I plugged it in. It comes in as a friendly HID device. My ultimate goal is to help a friend develop a PC game that uses these. His programming language of choice is DirectX in VB6. Because for the most part DX is DX whatever language you use it in, I'm comfortable troubleshooting this problem in my preferred language C#. Here's what I have:
            DeviceList devices = Manager.GetDevices(
DeviceClass.GameControl,
EnumDevicesFlags.AttachedOnly);

//create device from the first device found
foreach (DeviceInstance di in devices)
{
controller = new Device(di.InstanceGuid);
break;
}

if (controller == null)
{
}
else
{
controller.Acquire();
}


This code (when run) will pick the correct HID device (it doesn't work if the dongle isn't plugged in). At this point I am completely lost as to how to get the up/down state of the 5 buttons on a controller. I feel like I need to SetDataFormat(), but I am way lost on the parameter for that function if I am using a proprietary HID device (not a mouse/keyboard/joystick). Any help would be greatly appreciated (in C#/VB .NET or VB6). Thanks, AceGambit

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628395
• Total Posts
2982432

• 10
• 9
• 19
• 24
• 9