AutoHotkey Community

It is currently May 27th, 2012, 11:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: bind 1 key to 2 actions
PostPosted: October 19th, 2005, 9:38 am 
I have a question, Can somebody tell me the code for a script for the following action : Press the key "w" one time and it automatically detects it as
"w,w" just like you would double tapp "w" right now with about a half second pauze in it? (cause you can never tapp it so fast)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2005, 11:56 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
You could use "Send w" twice. Is that what you want?

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2005, 1:16 pm 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
Code:
$w::
send, {blind}w   ; Blind is for Alt-w, etc. also
sleep, 50        ; If you want a pause
send, {blind}w
return


Peter


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2005, 3:29 pm 
I think it's that's the code but I don't want to bind it with a key. So I don't want to press alt first then W for the script to work. Also Can the script be longer so it can contain more keys? for example ; double W, double p, double m etc.
If it's too hard work never mind then but I would really aprieciate your work and help.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2005, 6:18 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
You can do what ever you want to do. There is no limit that I know of.
Code:
w::
  Send, !w!w
  Send, !+w!+w
  Send, !q!q
  Send, !m!m
Return


To find more, please read the manual. Specifically the section on "hotkeys" and the "Send" command. Thanks

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2005, 7:43 pm 
Thank you very much, I couldn't find what I was looking for on this site.
And I will definitely check out that section :) thanks again


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2005, 2:31 pm 
I bumped at this problem. It doesn't go quite like I said.

example--> "w" then wait half sec and then tap w again and hold it.

explaination : w,half sec,w<-----hold this one! but I want w to be tapped once to do the same action and hold it as long as I like.

and there's another thing.
I have a key (r) that I press as long as I like. But after 1,5 seconds I want a other key (t) to be tapped only once! so it's like

example---->RRRRRRRRRR,T,RRRRRRRRRRRRRR
explain---->hold R as long as you like but after 1.5 seconds I want a other key to be pushed once, in this case T. But im still holding the R BUTTON!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2005, 10:04 pm 
Nobody?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2005, 10:37 pm 
Offline

Joined: October 7th, 2005, 9:46 pm
Posts: 13
Try this in combination w/ the above suggestions.
To hold a key, you can use {(key) down} and {(key) up}
Code:
Send, {w}
Sleep, 500
Send, {w down}

Send, {r down}
Sleep, 1000
Send, {r up}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 12:10 pm 
thanks it works.
Does anybody know how to do this too.

arrow down,arrowdown+arrowleft (= at same time),arrow left

just Like if you would press it right now.

it's for a game :p thx allot


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 12:23 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
Did you ever try to do it yourself?
Maybe reading the Manuel may help.
http://www.autohotkey.com/docs/Hotkeys.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 12:57 pm 
yes but I don't get it. Im 12 years and Im dutch.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 1:16 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
Ok, so let us try to understand, what we need:
Here is the list of Typed Buttons, we need.
Code:
VK  SC   Type   Up/Dn   Elapsed   Key   
28  150   i      d      4.17   DOWN        
28  150   i      u      0.00   DOWN      
28  150   i      d      0.02   DOWN        
25  14B   i      d      0.02   LEFT      
25  14B   i      u      0.00   LEFT        
28  150   i      u      0.02   DOWN        
25  14B   i      d      0.02   LEFT        
25  14B   i      u      0.00   LEFT     


you can see, from the table, when to press, and when to release a button.
You can pres a Button by using the send-command:
send {Left} will result in presing the left buton, and releasing it.
If you want to press it, and dont release it, use:
Send {left Down}
if you want to release it again, use this command:
Send {left up}

This is all, you need, try it, and tell us, if it works


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 2:00 pm 
YES IT WORKS!!!! thank you very much!!!!
I did only send, up
send, down etc
but thank you so much


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 2:50 pm 
Now I have this problem with this script I made:

send, {r down}
sleep, 100
send, {t down}
sleep, 60
send, {t up}
sleep, 3000
send, {r up}
return

Explaination : I want to hold R as long as I want, but after about 1 sec I want T to be press like above but then again im still holding the R button. And just release it when I want to.

maybe the script has mistakes but im still a beginner :(


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: MSN [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group