Discussion:
DirectInput no input yet device not lost
(too old to reply)
Voxoid
2010-02-01 15:07:01 UTC
Permalink
Hi,

I'm using DirectInput from DirectX 9.0c (along with Direct3D). When I start
my app in fullscreen mode, 1 out of about 10 times I get no input response
(mouse and keyboard), more frequently with lower resolutions for some reason.
From debugging when this happens, I see that I'm receiving no data from the
DirectIntput GetDeviceData() call. I would expect that the reason I'm not
getting any input data is because the device was lost (from exclusive mode),
but it does not return a lost device code but rather it returns success. Once
I "alt+tab" out of my app and back, DirectInput starts giving my app input
data.

I've also tried calling SetFocus() on my window each graphics frame. Then I
tried asking DirectInput to reaquire the device every frame. Neither of these
worked. I don't understand because if another program is snatching input
focus from my app/window, DirectInput should indicate that the device was
lost, right?

Does anyone know of any circumstance under which you will get no device
data, even when the device has not been lost?

Windows Vista Home
DirectX 9.0c (wrapped with Ogre3D and OIS libraries)
Visual C++ 2008 Express

Thanks in advance.
Phil Taylor
2010-04-15 23:20:01 UTC
Permalink
does the debug runtime output provide any clues?
--
Phil Taylor
http://www.futuregpu.net
now Intel Larrabee Native Title Czar
ex-Aces Core Lead PM, D3D SDK PM
somewhat DX knowledgeable :-)
Post by Voxoid
Hi,
I'm using DirectInput from DirectX 9.0c (along with Direct3D). When I start
my app in fullscreen mode, 1 out of about 10 times I get no input response
(mouse and keyboard), more frequently with lower resolutions for some reason.
From debugging when this happens, I see that I'm receiving no data from the
DirectIntput GetDeviceData() call. I would expect that the reason I'm not
getting any input data is because the device was lost (from exclusive mode),
but it does not return a lost device code but rather it returns success. Once
I "alt+tab" out of my app and back, DirectInput starts giving my app input
data.
I've also tried calling SetFocus() on my window each graphics frame. Then I
tried asking DirectInput to reaquire the device every frame. Neither of these
worked. I don't understand because if another program is snatching input
focus from my app/window, DirectInput should indicate that the device was
lost, right?
Does anyone know of any circumstance under which you will get no device
data, even when the device has not been lost?
Windows Vista Home
DirectX 9.0c (wrapped with Ogre3D and OIS libraries)
Visual C++ 2008 Express
Thanks in advance.
Loading...