AutoHotkey: ScrollLock functionality: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
; 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 21: | Line 22: | ||
ControlGetFocus sActivePanel, A | ControlGetFocus sActivePanel, A | ||
PostMessage 0x115, xnDirecton, 0, %sActivePanel%, A | PostMessage 0x115, xnDirecton, 0, %sActivePanel%, A | ||
Return | |||
} | |||
; 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 | Return | ||
} | } |
Revision as of 17:15, 17 June 2005
; 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 } ; 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