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 

help with remapping keys script for HTPC

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



Joined: 26 May 2009
Posts: 8

PostPosted: Tue May 26, 2009 5:16 am    Post subject: help with remapping keys script for HTPC Reply with quote

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
Back to top
View user's profile Send private message
!Guest
Guest





PostPosted: Tue May 26, 2009 9:24 pm    Post subject: Reply with quote

Try with the built in var A_TimeSinceThisHotkey
Back to top
kiwijunglist



Joined: 26 May 2009
Posts: 8

PostPosted: Wed May 27, 2009 5:33 am    Post subject: Reply with quote

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.
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