Setting a Hotkey with Suspend, Permit

Get help with using AutoHotkey and its commands and hotkeys
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Setting a Hotkey with Suspend, Permit

06 Nov 2017, 10:24

Hey guys,

I have my hotkeys suspended and want to make a hotkey not suspended for Spotify playback. I've tried Suspend, Permit before and after the hotkeys, but no luck :(

Code: Select all

Suspend, Permit
^Left::Media_Prev
Suspend, Permit
^Right::Media_Next
Suspend, Permit
^UP::Media_Play_Pause
Suspend, Permit
^PGUP::Volume_Up
Suspend, Permit
^PGDN::Volume_Down
Suspend, Permit
User avatar
Delta Pythagorean
Posts: 567
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: Setting a Hotkey with Suspend, Permit

06 Nov 2017, 10:38

Have you checked the docs for Suspend?
Permit: Does nothing except mark the current subroutine as being exempt from suspension.
I think this is what you're wanting

Code: Select all

^Left::
	Suspend, Permit
	SendInput, {Media_Prev}
	Return

^Right::
	Suspend, Permit
	SendInput, {Media_Next}
	Return

^UP::
	Suspend, Permit
	SendInput, {Media_Play_Pause}
	Return

^PGUP::
	Suspend, Permit
	SendInput, {Volume_Up}
	Return

^PGDN::
	Suspend, Permit
	SendInput, {Volume_Down}
	Return

- [AHK].......: 1.1.33.02 Unicode 64-bit
- [OS].........: Windows 10.0.18362
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Delta#3324

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Re: Setting a Hotkey with Suspend, Permit

06 Nov 2017, 10:49

Delta Pythagorean wrote:Have you checked the docs for Suspend?
Permit: Does nothing except mark the current subroutine as being exempt from suspension.
I think this is what you're wanting

Code: Select all

^Left::
	Suspend, Permit
	SendInput, {Media_Prev}
	Return

^Right::
	Suspend, Permit
	SendInput, {Media_Next}
	Return

^UP::
	Suspend, Permit
	SendInput, {Media_Play_Pause}
	Return

^PGUP::
	Suspend, Permit
	SendInput, {Volume_Up}
	Return

^PGDN::
	Suspend, Permit
	SendInput, {Volume_Down}
	Return
OHHH you need the brackets. Thank you so much. I think my brain was still numb from this time change.

Return to “Ask For Help”

Who is online

Users browsing this forum: BekaStorm, DanRim, Flipeador, glnklein, mikeyww and 56 guests