Jump to content

Keystrokes to minimized game


Guest darkmush
 Share

Recommended Posts

Guest darkmush

how would i send a keystroke to a minimized game, for example.. CS

so lets say i wanted my char to continually jump (ctrl), so i want to send the keystroke for ctrl to the cs window,and put it in a loop, so whether i am in the game, or the game is minimized, id be constantly jumping

oh, and the cs window would be called CS

for $jump = 1 to 50

(code for jumpiing minimized)

next

what would the code be

and what does this code do?

Func sendenter()
    $hwnd = WinGetHandle($gunzwindow)
    If $hwnd <> "" Then
        PostKeyPress($hwnd, 13)
    EndIf
EndFunc

Func PostKeyPress($hwnd, $key)
  $WM_KEYDOWN = 256
  $WM_KEYUP = 257
  $aR = DllCall("user32", "long", "PostMessageA", "hwnd", $hwnd, "long", $WM_KEYDOWN, "long", $key, "int", 0)
  $aR = DllCall("user32", "long", "PostMessageA", "hwnd", $hwnd, "long", $WM_KEYUP, "long", $key, "int", 0)
EndFunc

from what i know, is it takes the window of the game "gunz", and then sends the keycode 13 (enter) to it

i changed this keycode to something like space "32", but it doesnt register, and make the char jump

what i then did, was press enter myself, which allowed me to type text in, and the spaces that were supposed to be sent to the program periodically were registering into the chatbar

how do i make it so taht the game actually jumps, when space is sent, rather than ignore it unless thers a text box to type into

Edited by darkmush
Link to comment
Share on other sites

Guest darkmush

the code that i posted there was used in someone else's program for pressing enter while the game was minimized, isnt that sending keystrokes? or its actualyl soemthing else

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...