AutoHotkey Community

It is currently May 26th, 2012, 6:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: PriorHotkey alternative
PostPosted: February 29th, 2008, 5:51 pm 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
Code:
~*LControl Up::
 If ( A_ThisHotkey == A_PriorHotkey and A_TimeSincePriorHotkey < 400 )
    MsgBox, Ctrl²

With the above code u need to release Ctrl key to activate msg, is there an alternative that activates when Ctrl is pressed for second time?

I really appreciate ur patience,

Thanks alot!

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 29th, 2008, 5:59 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Did works for me (without any other script or hotkey running):
Code:
~*LControl::
 If ( A_ThisHotkey == A_PriorHotkey and A_TimeSincePriorHotkey < 400 )
    MsgBox, Ctrl²
Return

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2008, 7:36 pm 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
It does work, just that if u keep Ctrl pressed it´ll trigger and that is not wanted.
This code works just the same, but activated on key release as well
Code:
~*LControl::
Loop
   If ! GetKeyState( "LControl","P" )
      Break
     
 If ( A_ThisHotkey == A_PriorHotkey and A_TimeSincePriorHotkey < 400 )
   MsgBox, Ctrl²     
Return

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2008, 7:52 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Code:
~*LControl::
 If ( A_ThisHotkey == A_PriorHotkey and A_TimeSincePriorHotkey < 400 )
    MsgBox, Ctrl²
 KeyWait Control
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2008, 9:36 am 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
wow, thank you alot it works just like i wanted.

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon, Exabot [Bot], kkkddd1, Tipsy3000, Yahoo [Bot] and 71 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