Bkid
Joined: 26 Sep 2005 Posts: 44 Location: Hephzibah, GA
|
Posted: Fri Nov 02, 2007 6:17 am Post subject: Button presses are sporadic/Can't press simultaneous buttons |
|
|
I'm on a roll with questions this week...
Anyway, I'm having trouble with two things.
1) The way that this code is currently set up, the buttons are delayed correctly, but while playing the game they are sporadic and sometimes really delayed. I would like the buttons to be delayed ONLY as much as I set for the key delay (I used sleep and a variable).
2) I can't do both of these things at the same time: Hold buttons and press two buttons simultaneously. Is it really one or the other?
I was thinking about setting all of the buttons up kind of like "g" is set up (see below), but I just couldn't get it working right..
| Code: | WatchAxis:
GetKeyState, JoyY, JoyY
KeyToHoldDownPrev = %KeyToHoldDown%
if JoyY > 70
KeyToHoldDown =
else if JoyY < 30
{
Sleep, %buttondelay%
KeyToHoldDown = g
}
else
KeyToHoldDown =
if KeyToHoldDown = %KeyToHoldDownPrev%
return
if KeyToHoldDownPrev
Send, {%KeyToHoldDownPrev% up}
if KeyToHoldDown
Send, {%KeyToHoldDown% down}
return
Joy1::
GetKeyState, Joy1State, Joy1
kthdpjoy1 = %kthdjoy1%
if Joy1State = U
kthdjoy1 =
else if Joy1State = D
{
Sleep, %buttondelay%
kthdjoy1 = z
}
else
kthdjoy1 =
if kthdjoy1 = %kthdpjoy1%
return
if kthdpjoy1
Send, {%kthdpjoy1% up}
if kthdjoy1
Send, {%kthdjoy1% down}
return
Joy2::
Sleep, %buttondelay%
Send {s down}{s up}
return
Joy8::
Sleep, %buttondelay%
Send {x down}{x up}
return
Joy3::
Sleep, %buttondelay%
Send {d down}{d up}
return
Joy7::
Sleep, %buttondelay%
Send {c down}{c up}
return
Joy4::
Sleep, %buttondelay%
Send {f down}{f up}
return
Joy6::
Sleep, %buttondelay%
Send {v down}{v up}
return
Joy5::
Sleep, %buttondelay%
Send {b down}{b up}
return
Joy10::
Send, {Home down}{Home up}
return
Joy9::
Send, {Esc down}{Esc up}
return |
_________________ --Bkid-- |
|