| View previous topic :: View next topic |
| Author |
Message |
kiwijunglist
Joined: 26 May 2009 Posts: 8
|
Posted: Tue May 26, 2009 5:16 am Post subject: help with remapping keys script for HTPC |
|
|
| 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 |
|
 |
!Guest Guest
|
Posted: Tue May 26, 2009 9:24 pm Post subject: |
|
|
| Try with the built in var A_TimeSinceThisHotkey |
|
| Back to top |
|
 |
kiwijunglist
Joined: 26 May 2009 Posts: 8
|
Posted: Wed May 27, 2009 5:33 am Post subject: |
|
|
| 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 |
|
 |
|