Send an input to a specific active/inactive window only

Ask gaming related questions (AHK v1.1 and older)
User avatar
owopeachy
Posts: 11
Joined: 28 Jan 2020, 04:04

Send an input to a specific active/inactive window only

28 Jan 2020, 04:13

Hey there folks ive been trying to figure out how to send a spacebar input to a monster hunter world window, but i cant seem to get it working
from what i understand i should be able to get the right window using ahk_exe and then send a spacebar input with ControlSend and repeat, and it should work even if the window is not active, but i dont really know how to go about this :cry:
could u provide any example code?
Thank!

EDIT:
i found this piece which i adapted to do what i'd like, and it works in other windows but not in the game window, any idea why?

Code: Select all

msgbox, Press ctrl+h in the monster hunter window to bind to it, and press f5 to start sending space. To pause inputs, press Pause, to close the script, press End

;Autoclicker is working in background
;All The Rest is not
;Coordmode, tooltip, screen
;coordmode, pixel, screen
;Coordmode, mouse, screen
#InstallKeybdHook
#SingleInstance, Force
DetectHiddenWindows, on
;SetControlDelay 1
SetBatchLines -1
Thread, Interrupt, 0
SetFormat, float, 0.0

^h::
WinGet, active_pid, PID, A
return

f5::
loop
{
sleep 300
controlSend,ahk_parent,{Space},ahk_pid %active_pid%,
}
Return


end::
exitapp

pause::
pause, toggle,
tooltip, Paused, 20, 20

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 80 guests