Sign in to follow this  
AceGambit

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)
            {
                Console.WriteLine("Controller not found.");
            }
            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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this