Key Topic is solved

Ask gaming related questions (AHK v1.1 and older)
SonGokuBg
Posts: 72
Joined: 27 Aug 2017, 12:40

Key

14 Apr 2020, 09:25

when I am in random adventure (like Super mario) game, Send{w} (jumping) doesn't work

Code: Select all

#NoEnv
#SingleInstance, force
SendMode, Input
#UseHook

CoordMode, Mouse, Screen
;GUI...............................................
GUI, 1:+AlwaysOnTop +ToolWindow +E0x20
GUI, 1:Color, 0xFF0000
GUI, 1:Show, x800 y0 w5 h1000,Gui 1


GUI, 2:+AlwaysOnTop +ToolWindow +E0x20
GUI, Color, 0xFF0000
GUI, 2:Show, x895 y0 w5 h1000,Gui 2
;....................................................
#Persistent
stateA := False
SetTimer, labelA, 25


#Persistent
stateD := False
SetTimer, labelB, 25
return

;PRESSING KEYS WITH MOUSE COORDINATES
labelA:
    if(mouseInRegion(0, 0, 800, 1079)) {
        Send, {Left down}
        stateA := True
    } else if(stateA) {
        Send, {Left up}
        stateA := False
    }


labelB:
    if(mouseInRegion(900,0,1919,1079)) {
        Send, {Right down}
        stateB := True
    } else if(stateB) {
        Send, {Right up}
        stateB := False
    }
return
;................................................................

~LButton::
Send {w}
return

mouseInRegion(x1, y1, x2, y2) {
    MouseGetPos x, y
    return (x >= x1) && (x <= x2) && (y >= y1) && (y <= y2)
}
o::ExitApp
m::Suspend
SonGokuBg
Posts: 72
Joined: 27 Aug 2017, 12:40

Re: Key  Topic is solved

14 Apr 2020, 13:22

this work

Code: Select all

#NoEnv
#SingleInstance, force
SendMode, Input
#UseHook

CoordMode, Mouse, Screen
;GUI...............................................
GUI, 1:+AlwaysOnTop +ToolWindow +E0x20
GUI, 1:Color, 0xFF0000
GUI, 1:Show, x800 y0 w5 h1000,Gui 1


GUI, 2:+AlwaysOnTop +ToolWindow +E0x20
GUI, Color, 0xFF0000
GUI, 2:Show, x895 y0 w5 h1000,Gui 2
;....................................................
#Persistent
stateA := False
SetTimer, labelA, 25


#Persistent
stateD := False
SetTimer, labelB, 25
return

;PRESSING KEYS WITH MOUSE COORDINATES
labelA:
    if(mouseInRegion(0, 0, 800, 1079)) {
        Send, {Left down}
        stateA := True
    } else if(stateA) {
        Send, {Left up}
        stateA := False
    }


labelB:
    if(mouseInRegion(900,0,1919,1079)) {
        Send, {Right down}
        stateB := True
    } else if(stateB) {
        Send, {Right up}
        stateB := False
    }

LButton::
SetTimer, ClickBackUp, -1
LButton_Tick := A_TickCount


ClickBackUp:
Send {Up Down}
if !(GetKeyState("LButton" , "P"))
{
Send {Up up}
Send {LButton up}
}
else
SetTimer, ClickBackUp, -1

return
;................................................................


mouseInRegion(x1, y1, x2, y2) {
    MouseGetPos x, y
    return (x >= x1) && (x <= x2) && (y >= y1) && (y <= y2)
}
o::ExitApp
m::Suspend

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 102 guests