Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

hajkr

problem with reacquiring the keyboarddevice...

This topic is 6062 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 have made a standard keyboard device with directx8 and it works great until another application gets the focus and i then my application gets the focus back and i want to reacquire the device when i receive the WM_ACTIVE message with m_pDevice->Acquire( ). But when the app gets the focus back it return an device-error. Does anybody have an solution ?

Share this post


Link to post
Share on other sites
Advertisement
Have you tried different cooperative levels for your keyboard? You might want to try setting it to non exclusive and in the background.





------------------------------
"I''m a decorated astronaut, I don''t make those kind of mistakes."
"Oh now wait a minute. Look I''ll show ya. I''ll enter the same calculations using what we like to call ''The Right Way''."

-Rem
Zirem Software

Share this post


Link to post
Share on other sites
Yes i already have tried all possible combinations of cooperative flags. I think thats not the problem.

Share this post


Link to post
Share on other sites
I think your problem is that your aquiring the keyboard when your app loses focus and regains focus.

Try acquring the keyboard when you receive focus, and release it when you lose focus.

Personally, my DirectX lib doesn''t have this problem



------------------------------
"I''m a decorated astronaut, I don''t make those kind of mistakes."
"Oh now wait a minute. Look I''ll show ya. I''ll enter the same calculations using what we like to call ''The Right Way''."

-Rem
Zirem Software

Share this post


Link to post
Share on other sites
i acpuire the device when i get the focus.
But do i really need to unacquire it when i loose the focus?
Doesn''t it unacquire by itself or by windows?

Share this post


Link to post
Share on other sites
As far as I know, it doesn''t.



------------------------------
"I''m a decorated astronaut, I don''t make those kind of mistakes."
"Oh now wait a minute. Look I''ll show ya. I''ll enter the same calculations using what we like to call ''The Right Way''."

-Rem
Zirem Software

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey What kind of error is Acquire returning?

Share this post


Link to post
Share on other sites
It returns DIERR_NOTACQUIRED, when i call "GetDeviceState()"
But i''m acquierung it when the WM_ACTIVE-Message arives and there it returns no error.
So I don''t understand why it can not be acquired.

Share this post


Link to post
Share on other sites
...and if i try to acquire it every frame before i use "GetDiveState()" it returns DIERR_OTHERAPPHASPRIO.
I can''t understand that.

Share this post


Link to post
Share on other sites
This is unlikely, but it could just be your development machine. Hit Ctrl-Alt-Del to get the task list and close all unrelated processes. There might be something running there that has taken control of the keyboard.

Superpig
- saving pigs from untimely fates

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!