ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: go to parent folder with double-click

<< < (4/5) > >>

Nighted:
You can do this with QT TabBar. (I'm referring to what you mentioned in the first post)

ak_:
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 :)

justice:
Excellent stuff ak_!

ak_:
Thanks Justice :)

Ok i took care of another annoying bug i didn't notice : if you clicked on scrollbar then on whitespace very quickly, the program understood this as a double-click and went to parent folder.


--- ---; 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.
; Thanks to Justice for showing me the first steps and coming up with the name "DaddyClick" :)

#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
    Gosub End
If ControlClass <> SysListView321 ;if not Clicking filelist's whiteSpace
    Gosub End

; 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
        Gosub End
If MouseX Between %VScrollX% and %VScrollX2%
    If cStyle & 0x200000
        Gosub End

If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < 500 and nbClick = 1) {
    If (IsSelected = 1) ; if a file or folder is selected
        Gosub End

    ; 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

End:
nbClick = 0
Exit

Now, this Desktop thing :)

ak_:
"Good news everyone !"


I fixed the "desktop thing" in DaddyClick.

Moreover, in order to keep on experimenting AHK i decided to turn DaddyClick in some kind of open/save box enhancer (hm, sort of...). So i put aside the Explorer compatibility to focus on open/save boxes, so now "prent foder double-click" still works in Explorer, but not folder auto-selection. This feature was too buggy in Explorer and i felt like it was a better thing to focus on one thing and try to do the best out of it.

Anyway, i added one feature to DaddyClick : a toolbar in the caption to quickly access different drives (instead of using combo box).


Any feedback would be appreciated :)

I don't paste code right now because it's really a mess :-[

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version