Jump to content
Sign in to follow this  
Guest darkmush

Keystrokes to minimized game

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)


what would the code be

and what does this code do?

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

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)

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

Share this post

Link to post
Share on other sites

It is not possible to send keystrokes to minimized windows. Only way to do it is to use controlsend, but I doubt very much that it will apply to what you need.


Share this post

Link to post
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

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.