Sign in to follow this  
Cosmosis

Managed DirectInput - Mouse

Recommended Posts

I'm having issues with getting the state of the mouse in managed DirectInput. I've scoured the forums, searched for tutorials, but so far I've come up empty. I'm using the Visual C# 2005 Express Beta.
mouse.SetCooperativeLevel(parent, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Foreground);
mouse.SetDataFormat(DeviceDataFormat.Mouse);
mouse.Acquire();

It throws an "ArgumentException" when I try to get the device state.
return mouse.GetDeviceState(typeof(MouseState));

I've tried different cooperative levels, and Ive tried different parameters to the call to GetDeviceState. All yield the same result. Does anyone know whats wrong? If you think I would be better off not using DirectInput for my mouse can you tell me why? thanks in advance!

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