AutoHotkey: Keyboard navigation for Background Transfer Manager: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
m (Added category AutoHotkey scripts)
mNo edit summary
Line 2: Line 2:
; // => http://www.ghisler.ch/wiki/index.php?title=AutoHotkey:_Keyboard_navigation_for_Background_Transfer_Manager
; // => http://www.ghisler.ch/wiki/index.php?title=AutoHotkey:_Keyboard_navigation_for_Background_Transfer_Manager
/* -->
/* -->
'''This script does not work with TC 7.50 yet,''' due to the missing window class name of BTM there. <br>
So far I didn't find a good solution, ideas welcome.
<!--  
<!--  
*/ ; --> <code><pre>
*/ ; --> <code><pre>
; ////////////////////////////////////////////////////////////////////////////
; /////////////////////////////////////////////////////////////////////////////////
; // TC_BTM_keyboard-navigation.ahk  (W) StatusQuo 2008  for TC 7.03
; // TC_BTM_keyboard-navigation.ahk  (W) StatusQuo 2008  for TC 7.0x (up to 7.04a)
; //  
; //  
; // adds keyboard navigation to background transfer manager:  
; // adds keyboard navigation to background transfer manager:  
; // (Shift+)TAB, Del
; // (Shift+)TAB, Del
; ////////////////////////////////////////////////////////////////////////////
; /////////////////////////////////////////////////////////////////////////////////
#SingleInstance, Force
#SingleInstance, Force

Revision as of 22:06, 26 February 2009

This script does not work with TC 7.50 yet, due to the missing window class name of BTM there.
So far I didn't find a good solution, ideas welcome.

	; /////////////////////////////////////////////////////////////////////////////////
	; // TC_BTM_keyboard-navigation.ahk  (W) StatusQuo 2008  for TC 7.0x (up to 7.04a)
	; // 
	; // 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