Click to See Complete Forum and Search --> : DirectX8 Input


Electroman
June 6th, 2004, 01:48 PM
I am using DInput8 and have it set up for a keyboard. Everything works fine until my program looses focus. Once this happens when my program tries to reacquire the device it keeps getting returned E_ACCESSDENIED. I can't figure out why I am getting this. Does anyone have any ideas?

Thanx

wien
June 6th, 2004, 05:25 PM
Where do you try to reaquire the device?

The way I do it is to simply try (once) to aquire the device if GetDeviceData returns DIERR_NOTACQUIRED or DIERR_INPUTLOST. If I don't get it back, I simply wait a frame (or some other time-interval) and try again. That way it should get the device back when the window is back in focus.

Electroman
June 6th, 2004, 07:16 PM
Thanx it turned out to be a error in my communicating between two threads that was causing a bug. When I was tracking down the bug the keyboard kept unacquiring when the IDE took focus :(.When I fixed that I then left a line out which messed things up again. I'm glad to say all is working fine again though :D.