Sign in to follow this  
Gavin Williams

DirectInput.Manager.GetDevices() does not return

Recommended Posts


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]

Share this post

Link to post
Share on other sites
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.

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