Results 1 to 4 of 4

Thread: Simple question about DirectInput8?

  1. #1

    Simple question about DirectInput8?

    Hi,

    If I set DirectInput cooperativelevel with DISCL_BACKGROUND and DISCL_NONEXCLUSIVE flags. Everything works perfect BUT!

    If I'm running in windowed mode and DISCL_BACKGROUND is implemented, then application receives input even it's not active. And when my window is not active I'm not updating the scene. So this causes a little problem.

    If I set cooperative flag DISCL_FOREGROUND among with DISCL_NONEXCLUSIVE then everything works fine until window loses its focus. And when it's activated again, DirectInput doesn't get keyboard state anymore?!?

    I'm aware that GetDeviceState returns DIERR_INPUTLOST if it cannot get device state, but even if I try to re-acquire device it doesn't help, UNTIL I set cooperativelevel again with DISCL_BACKGROUND flag, which gaves me same result if I use it in the first place (when initializing).

    So, what to do? I tried to set window to topmost before re-acquiring, but that didn't help either. Please, help ObiWan Kenobi. You are my only hope.
    - In a world without the wall and fences, who will need the Gates and Windows.

  2. #2

    Simple question about DirectInput8?

    are you re aquiring the device?

  3. #3

    Simple question about DirectInput8?

    Quote Originally Posted by tux
    are you re aquiring the device?
    Yes I was acquiring it ONCE per one main loop cycle. I Mean that in main loop I called GetDeviceState and if it gave "inputlost" result I called device.acquire, but that didn't help.

    Now I got it to work. I found DI tutorial from DX SDK and from there I saw that device.acquire is called in a while loop when input is lost. So I recoded my application so and put that acquire in a while loop and now it works perfectly.

    Thanks for your answer anyway.
    - In a world without the wall and fences, who will need the Gates and Windows.

  4. #4

    Simple question about DirectInput8?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •