AutoHotkey: Go To Parent Directory When Doubleclicking Border: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
 
(Version 1.1)
Line 1: Line 1:
  ; Script name: GoToParent.ahk
  ; Script name: GoToParent.ahk
; Version 1.1: Sluggish responsiveness corrected, now doubleclick speed is read from registry
   
   
  ; Doubleclicking the left/right border when TC is maximized enters the corresponding parent directory.
  ; Doubleclicking the left/right border when TC is maximized enters the corresponding parent directory.
  ; A neat side effect is that single clicking a border already activates the panel.
  ; A neat side effect is that single clicking a border already activates the panel.
   
   
  ; Adjust the DoubleClickInterval, 500 (time in milliseconds) to your needs.
  RegRead, DoubleClickSpeed, HKEY_CURRENT_USER, Control Panel\Mouse, DoubleClickSpeed
  If DoubleClickSpeed =
SetBatchLines, -1
  DoubleClickSpeed = 500
  WinWaitActive, ahk_class TTOTAL_CMD
SetTimer, DoubleClickInterval, 500
   
   
  ~LButton::
  ~LButton::
  ResetClickCount = false
  If WinNotActive, ahk_class TTOTAL_CMD
  Return
If A_TimeSincePriorHotkey >= %DoubleClickSpeed%
  ClickCount = 0
  MouseGetPos, xcoordinate
  MouseGetPos, xcoordinate
  If xcoordinate=4
  If xcoordinate = 4
{
  ClickCount++
  PostMessage 1075, 4001, , , ahk_class TTOTAL_CMD
}
If (xcoordinate = A_ScreenWidth+3)
  {
  {
    ClickCount++
  ClickCount++
    PostMessage 1075, 4001, , , ahk_class TTOTAL_CMD
  PostMessage 1075, 4002, , , ahk_class TTOTAL_CMD
  }
  }
  If (xcoordinate=A_ScreenWidth+3)
  If ClickCount = 2
  {
  {
    ClickCount++
  PostMessage 1075, 2002, , , ahk_class TTOTAL_CMD
    PostMessage 1075, 4002, , , ahk_class TTOTAL_CMD
  ClickCount = 0
  }
  }
If ClickCount >=2
    PostMessage 1075, 2002, , , ahk_class TTOTAL_CMD
ResetClickCount = true
Return
DoubleClickInterval:
If ResetClickCount = true
    ClickCount = 0
Return
Back to [[AutoHotkey]]

Revision as of 03:16, 14 June 2005

; Script name: GoToParent.ahk
; Version 1.1: Sluggish responsiveness corrected, now doubleclick speed is read from registry

; Doubleclicking the left/right border when TC is maximized enters the corresponding parent directory.
; A neat side effect is that single clicking a border already activates the panel.

RegRead, DoubleClickSpeed, HKEY_CURRENT_USER, Control Panel\Mouse, DoubleClickSpeed
If DoubleClickSpeed =
  DoubleClickSpeed = 500

~LButton::
If WinNotActive, ahk_class TTOTAL_CMD
  Return
If A_TimeSincePriorHotkey >= %DoubleClickSpeed%
  ClickCount = 0
MouseGetPos, xcoordinate
If xcoordinate = 4
{
  ClickCount++
  PostMessage 1075, 4001, , , ahk_class TTOTAL_CMD
}
If (xcoordinate = A_ScreenWidth+3)
{
  ClickCount++
  PostMessage 1075, 4002, , , ahk_class TTOTAL_CMD
}
If ClickCount = 2
{
  PostMessage 1075, 2002, , , ahk_class TTOTAL_CMD
  ClickCount = 0
}