AutoHotkey Community

It is currently May 26th, 2012, 7:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: May 26th, 2009, 6:16 am 
Offline

Joined: May 26th, 2009, 6:09 am
Posts: 8
Code:
SC122 Down::
  MyVar2 = 1
  Sleep 600
  MyVar2 = 0
Return
SC122 Up::
  If MyVar2 = 1
       {
       Send p
       }
       else
       {
       Send {Space}
       }
Return


SC122 is a button on the front of my HTPC case

The above script does the follow
If SC122 key is pressed once it sends a "p" (Play)
If SC122 key is pressed and held for >600 it sends a "space" (Pause) on release of the SC122 key

I would like to modify the script to send the space after 600ms rather than waiting for the key release. I would also like it to send a space rather than the "p" if it is double clicked within 250ms

ie

Press SC122 -> Wait 250ms, if it's only pressed once send a "p"
Press SC122 twice quickly within 250ms -> Send "Space" (Do not send a "p")
Press and hold SC122 for > 600ms -> Send a "Space", rather than waiting for release of the key


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2009, 10:24 pm 
Try with the built in var A_TimeSinceThisHotkey


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2009, 6:33 am 
Offline

Joined: May 26th, 2009, 6:09 am
Posts: 8
thanks i tried using this, but still couldn't get a sucessful code that offered double click and hold button support, that will send the keystroke during the keyhold rather than the keyrelease.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, dra, Exabot [Bot], Google Feedfetcher, rbrtryn and 61 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