Sign in to follow this  

Direct Input Lost

This topic is 3582 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

I'm using DInput. When I switch applications, DInput is lost and my App crashes. How Can I recover it? with D3D I just call Direct3DDevice->Reset() after releasing everything. How do I do it with DInput? (im using Version 8).

Share this post


Link to post
Share on other sites
When a DirectInput device is lost, calls to get data will return DIERR_INPUTLOST.

When you get a DIERR_INPUTLOST error you need to attept to re-acquire the device again (IDirectInputDevice8::Acquire). Take a look at the "Acquiring Devices" section of the SDK documentation for more info.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Also, I hope you're not using DirectInput for mouse or keyboard input...


Thanks for summing everything up in a single post regarding DirectInput and keyboard/mouse.

I have 2 follow-up questions on this:

1> Can you point to any VB.Net examples for doing the Raw input reading? (Or C# examples, which I'd be able to use for conversion to VB.Net?)

2> Is DirectInput still a good source for reading traditional ("pre-XBox compatible") joysticks/gamepads? Or are there newer/better methods for that now too? (btw, I'm working with DirectX9 through SlimDX)

Thanks for anything you can point me to!

-Matt

Share this post


Link to post
Share on other sites
Quote:
Original post by MattWorden
Never mind my question #1 -- I'm getting that piece figured out.

However, I am still curious about insights on #2.

Thanks,
-Matt


Yep, for joysticks/joypads that are not Xbox 360 compatible DirectInput is still the best way to go.

For Xbox 360 pads (aka "Microsoft Common Controller"), XInput is the way to go.

And as Steve mentioned, you shouldn't be using DirectInput for mouse or keyboard these days (back in the Windows 98 days maybe, but not now).

Share this post


Link to post
Share on other sites

This topic is 3582 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.

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