• Advertisement
Sign in to follow this  

DirectInput HID device access read.

This topic is 2892 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement