Last active
May 2, 2024 17:36
-
-
Save alimbada/9b28c4b2e94791e204ddd2adce7d1c8a to your computer and use it in GitHub Desktop.
Use CapsLock-<Number> hotkey to switch HDMI inputs, Capslock-[=/-] to turn TV on/off
This file contains hidden or 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
#Requires AutoHotkey v2.0 | |
#SingleInstance | |
#HotIf GetKeyState("CapsLock") | |
{ | |
1:: | |
{ | |
RunWait "lgtv --name MyTV --ssl setInput HDMI_3", , "Hide" | |
ToggleCapsLock() | |
} | |
2:: | |
{ | |
RunWait "lgtv --name MyTV --ssl setInput HDMI_4", , "Hide" | |
ToggleCapsLock() | |
} | |
-:: | |
{ | |
RunWait "lgtv --name MyTV --ssl off", , "Hide" | |
ToggleCapsLock() | |
} | |
=:: | |
{ | |
RunWait "lgtv --name MyTV --ssl on", , "Hide" | |
ToggleCapsLock() | |
} | |
Up:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton up", , "Hide" | |
ToggleCapsLock() | |
} | |
Down:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton down", , "Hide" | |
ToggleCapsLock() | |
} | |
Left:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton left", , "Hide" | |
ToggleCapsLock() | |
} | |
Right:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton right", , "Hide" | |
ToggleCapsLock() | |
} | |
Enter:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton enter", , "Hide" | |
ToggleCapsLock() | |
} | |
Backspace:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton back", , "Hide" | |
ToggleCapsLock() | |
} | |
Home:: | |
{ | |
RunWait "lgtv --name MyTV --ssl sendButton home", , "Hide" | |
ToggleCapsLock() | |
} | |
} | |
ToggleCapsLock() { | |
if GetKeyState("CapsLock", "T") = 1 | |
{ | |
SetCapsLockState False | |
} | |
else if GetKeyState("CapsLock", "T") = 0 | |
{ | |
SetCapsLockState True | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires https://github.com/klattimer/LGWebOSRemote
See comment on this gist for instructions on how to set it up: https://gist.github.com/alimbada/9bd28e5a8fb98b1e96cbea8db1cda2b2