Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ScriptVersion = 1.1
- #Singleinstance,force
- GoSub, MainProgram
- return
- mainprogram:
- SetTitleMatchMode, 2
- WinGet, id, list, - VLC media player,, Program Manager
- Windows =
- Loop, %id%
- {
- StringTrimRight, this_id, id%a_index%, 0
- Windows := this_id . "," . Windows
- }
- StringTrimRight, Windows, Windows, 1
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- ~]::LoopControlSend(Windows, "]")
- ~[::LoopControlSend(Windows, "[")
- ~j::LoopControlSend(Windows, "j")
- ~k::LoopControlSend(Windows, "k")
- ~space::LoopControlSend(Windows, "{space}")
- ~+left::LoopControlSend(Windows, "+{left}")
- ~!left::LoopControlSend(Windows, "!{left}")
- ~^left::LoopControlSend(Windows, "^{left}")
- ~+right::LoopControlSend(Windows, "+{right}")
- ~!right::LoopControlSend(Windows, "!{right}")
- ~^right::LoopControlSend(Windows, "^{right}")
- ~^up::LoopControlSend(Windows, "^{up}")
- ~^down::LoopControlSend(Windows, "^{down}")
- ; for active windows only. use this to adjust speed when out of sync
- ~left::ActiveWindowSend(Windows, "+{left}")
- ~right::ActiveWindowSend(Windows, "+{right}")
- ~up::ActiveWindowSend(Windows, "^{left}")
- ~down::ActiveWindowSend(Windows, "^{right}")
- return
- LoopControlSend(Windows, x)
- {
- WinGet, active_id, ID, A
- is_valid_window = 0
- Loop,Parse,Windows,CSV
- {
- if active_id = %A_LoopField%
- {
- is_valid_window = 1
- break
- }
- }
- if is_valid_window
- {
- Loop,Parse,Windows,CSV
- {
- if active_id <> %A_LoopField%
- {
- ControlSend, , %x%, Ahk_Id %A_LoopField%
- }
- }
- }
- }
- ActiveWindowSend(Windows, x)
- {
- WinGet, active_id, ID, A
- is_valid_window = 0
- Loop,Parse,Windows,CSV
- {
- if active_id = %A_LoopField%
- {
- is_valid_window = 1
- break
- }
- }
- if is_valid_window
- {
- SendInput, %x%
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement