ness
ness

Reputation: 39

How to only trigger hotkey combo once?

I have this autohotkey script to make some media keys

RWin & AppsKey Up::Run calc1.exe
Pause::Media_Play_Pause
Ralt & F11::Media_Prev
Rcontrol & F11::Media_Prev

Ralt & F12::Media_Next
Rcontrol & F12::Media_Next

I'm trying to trigger previous and next track only once (if held),
I tried adding Up like I did with the AppsKey, but it doesn't work - it shows error when trying to run.
Interestingly Pause only triggers once.
And why can't I use CTRL+NUMLOCK? It actually triggers the Pause key...

Also, how do I assign a hotkey to the Wake key?

Upvotes: 0

Views: 586

Answers (1)

qiz_newbie
qiz_newbie

Reputation: 417

1,you can try this:

<!F11::
  send {Media_Prev}
  keywait F11
return
<!F12::
  send {Media_Next}
  keywait F12
return

here <! mean left alt key; keywait is used to wait a key to to released

2,because

While Ctrl is held down, NumLock produces the key code of Pause, so use ^Pause in hotkeys instead of ^NumLock

(from https://www.autohotkey.com/docs/KeyList.htm#numpad) enter image description here enter image description here

here is code for test:

Pause::
    tooltip you press "Pause"
return
NumLock::
    tooltip you press "NumLock"
return

;ctrl+numlock
^pause::
    tooltip you press "ctrl+numlock"
return
;ctrl+Pause
^CtrlBreak::
    tooltip you press "ctrl+Pause"
return

3, I don't have "wake" key,so I cannot test it, you maybe can try this: https://www.autohotkey.com/docs/KeyList.htm#SpecialKeys

Upvotes: 1

Related Questions