Skip to content

Instantly share code, notes, and snippets.

@josevh
Created September 5, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevh/52082f7360eaef7eb42b23a28c0d9579 to your computer and use it in GitHub Desktop.
Save josevh/52082f7360eaef7eb42b23a28c0d9579 to your computer and use it in GitHub Desktop.
Simulate media key presses
#pragma compile(FileDescription, SimulatedMediaKeys simulates media keys)
#pragma compile(ProductName, SimulatedMediaKeys)
#pragma compile(ProductVersion, 0.1)
#pragma compile(FileVersion, 0.0.0.1)
HotKeySet("^!{NUMPAD8}", "MediaPlay")
HotKeySet("^!{NUMPAD6}", "MediaNext")
HotKeySet("^!{NUMPAD4}", "MediaPrev")
HotKeySet("^!{NUMPAD5}", "MediaStop")
HotKeySet("^!{NUMPADSUB}", "MediaVolDown")
HotKeySet("^!{NUMPADADD}", "MediaVolUp")
While 1
Sleep(100)
WEnd
Func MediaPlay()
Send("{MEDIA_PLAY_PAUSE}")
EndFunc
Func MediaNext()
Send("{MEDIA_NEXT}")
EndFunc
Func MediaPrev()
Send("{MEDIA_PREV}")
EndFunc
Func MediaStop()
Send("{MEDIA_STOP}")
EndFunc
Func MediaVolUp()
Send("{VOLUME_UP}")
EndFunc
Func MediaVolDown()
Send("{VOLUME_DOWN}")
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment