Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SlimDX - Joystick

38 views
Skip to first unread message

Abdullah

unread,
Jan 20, 2012, 3:34:57 PM1/20/12
to
Hello, I'm trying to use my joystick with my GUI, I'm new to all this
so I apologies for my ignorance in advance.

So far, I have the following code related to Joystick initialization.
Ideally I want to have a combo box where we can select the joystick
device. I also would like to know how to get input from a joystick,
button presses etc.

--------------------------------
// Direct Input Settings - Joystick Configurations
// Get Joystick List
List<DeviceInstance> directInputList = new
List<DeviceInstance>(); // hold all input devices
DirectInput directInput = new DirectInput(); // get list

directInputList.AddRange(directInput.GetDevices(DeviceClass.GameController,
DeviceEnumerationFlags.AttachedOnly)); // specify joystick

// Create joystick device
Device _joystickDevice;
_joystickDevice = new
SlimDX.DirectInput.Joystick(directInput,
directInputList[0].InstanceGuid);

// Access Joystick
_joystickDevice.Acquire();
-------------------------------
0 new messages