DirectInput.Manager.GetDevices() does not return

Started by
0 comments, last by Gavin Williams 13 years, 5 months ago
Hi,

I'm trying to read input from the gamepad in XNA using DirectInput. When I try to get the available input devices with :

DeviceList devices = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);

it doesn't seem to return. Any ideas why this could be ?

I'm using XNA 4.0, Visual Studio 2010 Pro.

... EDIT ...

I tried creating an XNA 3.1 Project and it works fine. Something else I've noticed is that in my references in VS2008Exp DirectInput is available under the .NET tab while in VS2010Pro there are no DirectX namespaces available. I've made a manual link using Browse to :

C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0

Which makes the namespace available.

I have 2 thoughts :

1. I have to setup DirectX properly in the references.
2. DirectX for Managed Code doesn't work in VS2010.

I'll keep searching for a solution.

[Edited by - Gavin Williams on December 4, 2010 8:33:17 AM]
Advertisement
Well I've been searching and found how to add libs & includes under VS2010 for C++ projects but this still doesn't make the references available to my C# projects. Also I'm getting the impression that managed directX just won't work anymore (whether it's VS2010 or .NET 4.0 im not sure). So I'm going to take a look at using SlimDX with my XNA projects in order to access logitech (and other) gamepads.

This topic is closed to new replies.

Advertisement