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 

key count and different function for one key

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



Joined: 15 Aug 2008
Posts: 2

PostPosted: Fri Aug 15, 2008 1:54 pm    Post subject: key count and different function for one key Reply with quote

Hello,
Can you please help me with one little script? Here is my situation: I want a script that counts number of clicking particular key, in this case numpadenter and when its even (0, 2, 4 ..) then the key would work as alt-A and when its odd(1, 3, 5 ..) then the key would work as alt-B

So I load the script, press numpadenter and there would be alt A then I click it again and there would be alt-B then again Alt A... Thank you for your help if any will come Smile. Or if you don't want to help then at least show me the way where to look. I have been through the basics but this is too complicated for me as I am a newbie..
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Fri Aug 15, 2008 2:30 pm    Post subject: Reply with quote

See the example in the SetTimer documentation for detection of single, double, and triple-presses of a hotkey.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
HugoV



Joined: 27 May 2007
Posts: 650

PostPosted: Fri Aug 15, 2008 4:09 pm    Post subject: Reply with quote

For inspiration have a look here:
http://www.autohotkey.com/forum/topic32443.html
_________________
When parsing a CSV file use Loop, parse, Inputvar, CSV!
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Fri Aug 15, 2008 4:21 pm    Post subject: Reply with quote

Or if it's just toggling between two different keys
Code:
NumpadEnter::
   If (Toggle := !Toggle)
      Send !a
   Else
      Send !b
Return

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
Stultus



Joined: 15 Aug 2008
Posts: 2

PostPosted: Fri Aug 15, 2008 5:27 pm    Post subject: Reply with quote

Thanks a lot guys.
Back to top
View user's profile Send private message
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