Created
September 5, 2017 14:58
-
-
Save josevh/52082f7360eaef7eb42b23a28c0d9579 to your computer and use it in GitHub Desktop.
Simulate media key presses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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