AutoHotkey: Simultaneous switch to next/previous Tab in both panes

From TotalcmdWiki
Jump to: navigation, search
; If you press [Ctrl]+[tab] you switch in the active panel to the next Tab.
;
; The following script allows to switch the Tabs in both panels simultaneously
; by pressing [Altgr]+[Ctrl]+[Tab] (or [Altgr]+[Ctrl]+[Shift]+[Tab] to cycle backwards)
;
; The "<^>!Tab::" defines the hotkey
; The "IfWinActive" command checks if Total Commander is the active Window.
; "Postmessage...." If yes then send cm_SwitchToNextTab (code 3005)
; wait a moment ( 100 milliseconds)
; send "Tab" to switch to the other Panel
; "Postmessage...." sithc the other panel to the next tab with cm_SwitchToNextTab (code  3005)
; wait a moment ( 100 milliseconds)
; send "Tab" to switch back to the 'starting' Panel
; ready
; "<^>!Tab::" same procedure for shift with cm_switchToPreviousTab



<^>!Tab::


IfWinActive ahk_class TTOTAL_CMD
{
PostMessage, 1075, 3005, , , ahk_class TTOTAL_CMD
sleep,100
send, {Tab}
PostMessage, 1075, 3005, , , ahk_class TTOTAL_CMD
sleep,100
send, {Tab}
}
return

<^>!+Tab::

IfWinActive ahk_class TTOTAL_CMD
{
PostMessage, 1075, 3006, , , ahk_class TTOTAL_CMD
sleep,100
send, {Tab}
PostMessage, 1075, 3006, , , ahk_class TTOTAL_CMD
sleep,100
send, {Tab}
}
return



Back to AutoHotkey