Nighted> thanks for the info. However, as i have no use for other QT Tabbar's features, i don't feel like using it. And i like working on DaddyClick as a first ahk project anyway
Anyway, i updated DaddyClick and fixed a few bugs. Now, clicks on scrollbars (and more generally, clicks outside file list), are ignored. I also included the new icon.
Here's the code, sorry if it looks ugly :
; DaddyClick
; see http://translatecz.svarz.cz/2007/05/en-doubleclick-to-close-window.html for similar script
; or the various help pages on ControlSend etc.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetKeyDelay 0,0
~LButton Up::
; info about window/ control the mouse is hovering over
CoordMode Mouse,Screen
MouseGetPos,,,,ControlClass
MouseGetPos,MouseX,MouseY,id,ControlHwnd,2
WinGetClass, class, ahk_id %id%
If (class <> "#32770" and class <> "CabinetWClass" and class <> "ExploreWClass") ; if not open/save dialog OR explorer
Return
If ControlClass <> SysListView321 ;if not Clicking filelist's whiteSpace
Return
; Scrollbars detection
ControlGet cStyle, Style,,%ControlClass%, ahk_id %id%
WinGetPos winX, winY, winW, winH, ahk_id %id%
ControlGetPos ctlX, ctlY, ctlW, ctlH, %ControlClass%, ahk_id %id%
VScrollX2 := winx + ctlX + ctlW
VScrollX := VScrollX2 - 20
HScrollY2 := winy + ctlY + ctlH
HScrollY := HScrollY2 - 20
If MouseY Between %HScrollY% and %HScrollY2%
If cStyle & 0x100000
Return
If MouseX Between %VScrollX% and %VScrollX2%
If cStyle & 0x200000
Return
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < 500 and nbClick = 1) {
If (IsSelected = 1) ; if not Clicking filelist's whiteSpace
Return
; retrieve current folder depending on the window class
If (class = "#32770"){
ControlGetText prevDir, ComboBox1, ahk_class %class%
}
If (class = "ExploreWClass" or class = "CabinetWClass") {
ControlGetText prevDir, Edit1, ahk_class %class% ; retrieve current folder from Edit1 field
StringGetPos, SlashPos, prevDir, \, R1 ; get position of last \
SlashPos += 2 ; add 2 to the position so StringMid works
StringMid, prevDir, prevDir, SlashPos ; get part of the string, from last \ to the end
}
ControlSend,,{BS},ahk_id %ControlHwnd% ; Sends BackSpace
Sleep 50
Loop, Parse, prevDir
{
ControlSendRaw, SysListView321, %A_LoopField%, ahk_class %class% ; Sends letters from the previous folder's name one after another to reach folder quickly
ControlGet, testSelected, List, Selected, SysListView321, ahk_class %class% ; Checks selected folder
If (testSelected = prevDir) { ; if selected folder is the folder we come from
Break
}
}
nbClick = 2
} Else {
nbClick = 1
; checks if a file or folder is selected in the dialog box
ControlGet, IsSelected, List, Count Selected, SysListView321, ahk_id %id%
}
Return
Now i need to :
- find a way to ignore clicks when Desktop is active folder.
- prevent third click after double-click to be detected as a double-click (should be easy) done !
Again, thanks to Justice for showing me the first steps and for coming up with the name