AutoHotkey: Double click resets the splitter: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Note added) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
Detect a double click on the splitter, and set it to 50%. | Detect a double click on the splitter, and set it to 50%. | ||
Note: this script is obsolete, as it was implemented in TC long time ago. | |||
#IfWinActive ahk_class TTOTAL_CMD | #IfWinActive ahk_class TTOTAL_CMD | ||
Line 51: | Line 53: | ||
<BR>Back to [[AutoHotkey]]<BR> | <BR>Back to [[AutoHotkey]]<BR> | ||
[[Category:AutoHotkey scripts|Double click resets the splitter]] | |||
[[de:AutoHotkey: Starte Total Commander oder bringe sein Programmfenster in den Vordergrund]] | [[de:AutoHotkey: Starte Total Commander oder bringe sein Programmfenster in den Vordergrund]] |
Latest revision as of 14:09, 31 August 2011
Detect a double click on the splitter, and set it to 50%.
Note: this script is obsolete, as it was implemented in TC long time ago.
#IfWinActive ahk_class TTOTAL_CMD ~LButton:: ; Detect double click code: http://www.autohotkey.com/forum/viewtopic.php?p=62779#62779 Loop { LButtonDown := GetKeyState("LButton","P") If (!LButtonDown) Break } WaitTime:=DllCall( "GetDoubleClickTime" )/1000 KeyWait, LButton, D T%WaitTime% If errorlevel=0 GoSub, OnDoubleClick Return OnDoubleClick: ; Determine the splitter class name. ; Since there are more TPanel controls (the splitter is one of them), ; I use the dimensions of the controls to decide. WinGet sf_aControls, ControlList Loop Parse, sf_aControls, `n { StringLeft sf_sTemp, A_LoopField, 6 if (sf_sTemp = "TPanel") { ControlGetPos Cx,Cy,Cw,Ch, %A_LoopField% if (Cw < 16) { SplitterClass := A_LoopField Break } } } ; If the mouse is over the splitter, send cm_50Percent command. MouseGetPos, , , , ClassUnderMouse if (SplitterClass = ClassUnderMouse) { ; Wait for the left button to be released. ; This is necessary, beause if we send the cm_50Percent ; message when the button is still down, the splitter jumps back to the mouse. KeyWait LButton PostMessage 1075, 909, 0,, ahk_class TTOTAL_CMD ; cm_50Percent } Return
Back to AutoHotkey