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 

how to send simultanoues keypresses?

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



Joined: 22 Feb 2010
Posts: 2

PostPosted: Mon Feb 22, 2010 10:25 pm    Post subject: how to send simultanoues keypresses? Reply with quote

im trying to make macros for street fighter 4. but 1 problem i have is when the game calls for simultaneous button presses.

i use
Code:
Send {x down}{y down}{l down}

but the game will not take that as 3 simultaneous keystrokes but rather, x, then xy, then l. basically, it's inconsistent.

is there a way to truly send 3 simultaneous keystrokes as if im pressing down on them on my keyboard at the same time?


Last edited by adrian783 on Tue Feb 23, 2010 12:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5333
Location: San Diego, California

PostPosted: Tue Feb 23, 2010 12:01 am    Post subject: Reply with quote

edit: btw, your subject line says 2, the body of the post says 3. Embarassed

I doubt that a human, working through a keyboard can send all 3 keys simultaneously.

There are factors such as when a key is actually deemed 'hit'.
These are affected by contact wear and dirt and keyboard debouncing algorithm.

This is not difinitive, but you can check the Ahk response detection yourself. Run the first 3 scripts,
or just the last, the timing is several ms off either way.

A_TickCount
Arrow The number of milliseconds since the computer was rebooted. By storing A_TickCount in a variable, elapsed time

Code:
#SingleInstance, Force
return

a::ATime:= A_TickCount

f10::msgbox atime%atime%   ; read the hit times

Code:
#SingleInstance, Force
return

d::DTime:= A_TickCount

f12::msgbox dtime%dtime%   ; read the hit times

Code:
#SingleInstance, Force
return

s::STime:= A_TickCount

f11::msgbox stime%stime%   ; read the hit times


Don't use this script with the other 3, it will interfere with other scripts detecting the hotkey.

Code:
#SingleInstance, Force
return

a::ATime:= A_TickCount
s::STime:= A_TickCount
d::DTime:= A_TickCount

return

f11::msgbox atime%atime%`nstime%stime%`ndtime%dtime%   ; read the hit times
Back to top
View user's profile Send private message
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Tue Feb 23, 2010 12:11 am    Post subject: Reply with quote

Try SendInput, it will send the keys faster and will increase the possibility of the game recognizing it as a "simultaneous" key press.

I am pretty sure that a keyboard can not send more than one keystroke at a time.
Back to top
View user's profile Send private message
adrian783



Joined: 22 Feb 2010
Posts: 2

PostPosted: Tue Feb 23, 2010 12:24 am    Post subject: Reply with quote

godsstigma wrote:
Try SendInput, it will send the keys faster and will increase the possibility of the game recognizing it as a "simultaneous" key press.

I am pretty sure that a keyboard can not send more than one keystroke at a time.


Code:
#IfWinActive ahk_class STREET FIGHTER IV
k::
SendEvent {x down}{y down}{l down}
SendEvent {x up}{y up}{l up}
return


only send and send event works. input/raw/play doesn't seem to be recognized.
Back to top
View user's profile Send private message
Display posts from previous:   
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