AutoHotkey: ScrollLock functionality: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
 
(Added category AutoHotkey scripts)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The first script locks the cursor on the current file/folder while scrolling through the filelist with 'ScrollLock' key
  ; Total Commander:
  ; Total Commander:
  ; Scroll without moving the cursor if ScrollLock is turned on.
  ; Scroll without moving the cursor if ScrollLock is turned on.
;
   
   
  $Down:: TCScroll( 1 )
  $Down:: TCScroll( 1 )
  $Up:: TCScroll( 0 )
  $Up:: TCScroll( 0 )
   
   
  TCScroll( xnDirecton )
  TCScroll( xnDirecton )
Line 23: Line 27:
  Return
  Return
  }
  }
The second script allows you to scroll through the filelist without changing the cursor position in the file window by pressing [Ctrl]+[shift]+[Up/Down]. Thus you could always see the predecessor and the successor of a file. If you rather like to use [AltGr]+[Shift]+[Up/down] simply replace the first 3 lines of the script by the following
; Scroll, keeping the cursor in place
<^>!+Down:: TCScrollKeep( 1 )
<^>!+Up:: TCScrollKeep( 0 )
Here is the second script:
; Scroll, keeping the cursor in place
^+Down:: TCScrollKeep( 1 )
^+Up:: TCScrollKeep( 0 )
TCScrollKeep( xnDirecton )
{
if WinActive( "ahk_class TTOTAL_CMD" )
{
if xnDirecton = 1
Send {Down}
else
Send {Up}
ControlGetFocus sActivePanel, A
PostMessage 0x115, xnDirecton, 0, %sActivePanel%, A
}
Return
}




Back to [[AutoHotkey]]
Back to [[AutoHotkey]]
[[Category:AutoHotkey scripts|ScrollLock functionality]]
[[de:AutoHotkey: ScrollLock im TC nutzen]]

Latest revision as of 18:57, 1 June 2008

The first script locks the cursor on the current file/folder while scrolling through the filelist with 'ScrollLock' key


; Total Commander:

; Scroll without moving the cursor if ScrollLock is turned on.

$Down:: TCScroll( 1 )
$Up:: TCScroll( 0 )


TCScroll( xnDirecton )
{
	GetKeyState, sScrollLockState, ScrollLock, T

	if (not WinActive( "ahk_class TTOTAL_CMD" )) or (sScrollLockState != "D")
	{
		if (xnDirecton = 1)
			Send {Down}
		else
			Send {Up}
		Return
	}

	ControlGetFocus sActivePanel, A
	PostMessage 0x115, xnDirecton, 0, %sActivePanel%, A
	Return
}

The second script allows you to scroll through the filelist without changing the cursor position in the file window by pressing [Ctrl]+[shift]+[Up/Down]. Thus you could always see the predecessor and the successor of a file. If you rather like to use [AltGr]+[Shift]+[Up/down] simply replace the first 3 lines of the script by the following

; Scroll, keeping the cursor in place
<^>!+Down:: TCScrollKeep( 1 )
<^>!+Up:: TCScrollKeep( 0 )

Here is the second script:

; Scroll, keeping the cursor in place
^+Down:: TCScrollKeep( 1 )
^+Up:: TCScrollKeep( 0 )

TCScrollKeep( xnDirecton )
{
	if WinActive( "ahk_class TTOTAL_CMD" )
	{
		if xnDirecton = 1
			Send {Down}
		else
			Send {Up}
	ControlGetFocus sActivePanel, A
	PostMessage 0x115, xnDirecton, 0, %sActivePanel%, A
	}
	Return
}


Back to AutoHotkey