SendInput with DirectInput

Discussion in 'Windows Vista Drivers' started by Arik Yavilevich, Sep 11, 2004.

  1. Hello,

    Somebody posted that SendInput works with DirectInput.
    Can somebody confirm or deny this?

    I was trying to simulate key presses with SendInput or with
    keybd_event but couldn't receive them in a DirectInput application.

    Can someone shed some light on this.

    Arik Yavilevich.
    Arik Yavilevich, Sep 11, 2004
    1. Advertisements

  2. It works for Win 2000 and XP.
    Win9x does not work. There you need a small VxD to access the keyboard
    buffer which is buried deep inside the system.
    Robert Marquardt, Sep 12, 2004
    1. Advertisements

  3. I am using Win 2000 and it doesn't work.
    Can you provide more detail?

    Arik Yavilevich, Sep 12, 2004
  4. I have a self-written tray application on my desk which works well on
    Win 2000. It uses keybd_event and mouse_event.
    Robert Marquardt, Sep 13, 2004
  5. It seems I am doing the same thing here but it doesn't work and I
    asked somebody else to check it on his XP system and it doesn't work
    there too.

    I have two programs, one is a "server" program that does:
    and another "client" program that creates a directinput device for the
    keyboard and checks if buttons are down (using GetDeviceState).

    Now the "server" makes okay key presses because it affects "normal"
    windows application. But the key presses don't reach my "client" or an
    another DirectInput game I am using.

    BTW, I am using DirectInput8Create in the client. Maybe the issue is
    the version of direct x?

    Maybe you can send me your program or I will send you mine? Is it okay
    if I contact you using your email? We are getting a little off-topic

    I really want to figure this out,
    Arik Yavilevich, Sep 13, 2004
  6. Arik Yavilevich

    Ray Trent Guest

    Well, if you're opening a *particular* keyboard in your DirectInput app,
    rather than GUID_SysKeyboard, I doubt that you'll see anything from it.

    Without details it's really hard to judge what the problem might be. How
    about posting the code for the client instead... it's considerably more
    relevant to the question...
    Ray Trent, Sep 13, 2004
  7. For the record:
    Apparently you have to fill in the bScan parameter of keybd_event even
    though the MSDN says "This parameter is not used".

    Sweet programming to you all,
    Arik Yavilevich, Sep 13, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.