AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Button presses are sporadic/Can't press simultaneous buttons

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Bkid



Joined: 26 Sep 2005
Posts: 44
Location: Hephzibah, GA

PostPosted: Fri Nov 02, 2007 6:17 am    Post subject: Button presses are sporadic/Can't press simultaneous buttons Reply with quote

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--
Back to top
View user's profile Send private message Visit poster's website AIM Address
Bkid



Joined: 26 Sep 2005
Posts: 44
Location: Hephzibah, GA

PostPosted: Sat Nov 03, 2007 12:13 am    Post subject: Reply with quote

Can anyone else think of a good way to get this done? For right now I'm stumped. :<
_________________
--Bkid--
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group