Sign in to follow this  
Followers 0
Guest darkmush

Keystrokes to minimized game

3 posts in this topic

#1 ·  Posted (edited)

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

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.


CheersNobby

Share this post


Link to post
Share on other sites

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  
Followers 0