AutoHotkey: Keyboard navigation for Background Transfer Manager

From TotalcmdWiki
Revision as of 01:18, 17 July 2008 by StatusQuo (talk | contribs) (added)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
	; ////////////////////////////////////////////////////////////////////////////
	; // TC_BTM_keyboard-navigation.ahk  (W) StatusQuo 2008  for TC 7.03
	; // 
	; // adds keyboard navigation to background transfer manager: 
	; // (Shift+)TAB, Del
	; ////////////////////////////////////////////////////////////////////////////
	
#SingleInstance, Force
asControlNames := "ListBox1,Button1,Button2,Button3,Button4,Edit1,ListBox1"
Return

#IfWinActive, ahk_class DOWNDLGLIST2
	Del::	; === Remove selected download job(s)
		Send, {NumpadSub}
		Return
	Tab::	; === Focus next control in %asControlNames%
		ControlGetFocus, sFocus
		sLastControl := ""
		Loop, Parse, asControlNames, `,
		{
			if (sFocus = "")	; no focus at all
			{
				ControlFocus, ListBox1
				Break
			}
			if (sLastControl = sFocus)
			{
				ControlFocus, %A_LoopField%
				Break
			}
			sLastControl := A_LoopField
		}
		Return
	+Tab::	; === Focus previous control in %asControlNames%
		ControlGetFocus, sFocus
		sLastControl := ""
		Loop, Parse, asControlNames, `,
		{
			if (sFocus = "")	; no focus at all
			{
				ControlFocus, ListBox1
				Break
			}
			if (A_LoopField = sFocus)
			and (sLastControl != "")
			{
				ControlFocus, %sLastControl%
				Break
			}
			sLastControl := A_LoopField
		}
		Return

#IfWinActive

;

Back to AutoHotkey