Results 1 to 8 of 8
  1. #1
    unknown420's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0

    Sending keystrokes to DirectX / DirectInput

    So I am coding a (simple to start) bot for a game. I have tried multiple languages (C++, Vb.net, AutoIt) and no Sendkeys, Sendinput, Postmessage, etc works for DirectInput. I would prefer help in VB.Net since that is what I am most experienced in. Anyways, for the past maybe 3 days I have been searching up and down google for some examples or info on DirectInput hooking and sending keystrokes that way, but I can't find anything. All i'm trying to do is send a few keypresses to a DirectX game.

    If anyone has any info or could help me out, that'd be wonderful, thanks!

    Edit: I also have a keyboard hook already set up. Im still searching/trying to figure it out
    Last edited by unknown420; 11-23-2012 at 02:25 AM.

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Have you read and tried this?

    c# - Simulating Keyboard with SendInput API in DirectInput applications - Stack Overflow

    Dunno much about this or how to do it without any kind of hook. But that guy with SendInput seems that got it working.
    But I guess that someone more experienced might help you.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    unknown420's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by 'Bruno View Post
    Have you read and tried this?

    c# - Simulating Keyboard with SendInput API in DirectInput applications - Stack Overflow

    Dunno much about this or how to do it without any kind of hook. But that guy with SendInput seems that got it working.
    But I guess that someone more experienced might help you.
    Well, I'm not experienced in C#, so I am looking to get some help in VB.Net. I do know some C++, but not enough to accomplish what I'm aiming for

  4. #4
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    419
    Reputation
    9
    Thanks
    330
    My Mood
    Twisted
    c# and vb.net are very similar. Just convert it.

  5. #5
    unknown420's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    Converted it but doesn't seem to be working

  6. #6
    unknown420's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    Anyone have any ideas?

  7. #7
    leejw29's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    221
    Reputation
    10
    Thanks
    2,756
    I'm trying to do something like this as well.

    I'm trying to code a bot in vb.net that simply presses the "w" button on the keyboard.
    My problem is, it works fine in notepad, and everywhere else, except for when I'm in-game.
    It is Direct3D game, it does not move the character at all, however if I activate the chatbox, my program is able to sendkeys to the chatbox.

    Please, if you found a solution to send keystrokes to a Directx game, please share it here, before you go ~

  8. #8
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    I doubt keybd_event function (Windows) would work since none works.

    So I guess, start looking into Hooking like I said before.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

Similar Threads

  1. [Solved] Sending pre-set Hotkey Keystrokes to Vindictus
    By Legend2007 in forum Visual Basic Programming
    Replies: 12
    Last Post: 11-04-2013, 03:27 AM
  2. [Request]Help, Tut to send keystroke un-active program
    By VistaPiza in forum Visual Basic Programming
    Replies: 2
    Last Post: 02-16-2010, 09:40 PM
  3. blackpkerstr emty you mail box, I cant send anything to you
    By radnomguywfq3 in forum Spammers Corner
    Replies: 1
    Last Post: 02-25-2007, 11:51 AM
  4. send unlimited grenades one blow ?
    By leesan in forum WarRock - International Hacks
    Replies: 7
    Last Post: 02-21-2007, 07:24 PM
  5. Send quin back to the graveyard
    By System79 in forum General
    Replies: 35
    Last Post: 10-10-2006, 02:35 PM