Wishlist - feature request, Double click tab to close
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Wishlist - feature request, Double click tab to close
I would love to see a double click anywhere on a tab to close it in everything.
I've this implemented in my web browsers and file manager, directory opus.
I have tried to use autohotkey to automate this myself using #ifmouseover, double click sends Ctrl+w. ... It almost works. The hot is being sent but I'm getting a windows error chime as another element of the gui is receiving the key input so the tab remains open.
Thanks
Xavier
I've this implemented in my web browsers and file manager, directory opus.
I have tried to use autohotkey to automate this myself using #ifmouseover, double click sends Ctrl+w. ... It almost works. The hot is being sent but I'm getting a windows error chime as another element of the gui is receiving the key input so the tab remains open.
Thanks
Xavier
Re: Wishlist - feature request, Double click tab to close
I have put on my TODO list to add a customizable tabs_double_click_action advanced setting.
Thank you for the suggestion.
Thank you for the suggestion.
Re: Wishlist - feature request, Double click tab to close
Quick tip:
Clicking the scrollwheel will also close tabs. Works in Directory Opus and webbrowsers too.
Even in Explorer .. (where double-clicking doesn't)
Clicking the scrollwheel will also close tabs. Works in Directory Opus and webbrowsers too.
Even in Explorer .. (where double-clicking doesn't)
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Re: Wishlist - feature request, Double click tab to close
Awesome. Thank you. And will check out the middle click as well. Didn't think of that for some reason
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Re: Wishlist - feature request, Double click tab to close
okay after tinkering a few mins I got this ahk code to work using the middle mouse button...
Code: Select all
#IfWinActive ahk_exe Everything64.exe
~Lbutton:: ;; ev, double click on tab to close it
global control
ControlGetFocus, Control, ahk_exe Everything64.exe
if (A_PriorHotkey != "~Lbutton" or A_TimeSincePriorHotkey > 300)
{
KeyWait, Lbutton, u ; Too much time between presses, so this isn't a double-press.
return
}
else
{
If MouseIsOver(Control = "SysTabControl321")
{
sleep 90
send, {Mbutton}
}
#if
}
return
#IfWinActive
MouseIsOver(WinTitle) ;; MouseIsOver() ;; Function // SHARED
{
global control
MouseGetPos,,, Win,Control
return WinExist(WinTitle . " ahk_id " . Win . Control)
}
; might only need one of theses...
IsDoubleClick(MSec = 300) {
Return (A_ThisHotKey = A_PriorHotKey) && (A_TimeSincePriorHotkey < MSec)
}
IsDoubleClickEx(MSec = 300) {
preHotkey := RegExReplace(A_PriorHotkey, "i) Up$")
Return (A_ThisHotKey = preHotkey) && (A_TimeSincePriorHotkey < MSec)
}
Re: Wishlist - feature request, Double click tab to close
Thank you for sharing @Xavierarmand !
Quick tip: double-click speed is configurable in Windows (mouse settings). Some people might have a slow double-click speed (old / muscle troubles/..) or a fast one (pro-gamers/..).
You can read the Windows double-click speed in AHK using:
%$DoubleClickTime% contains the max number of milliseconds between clicks (here:500; I guess that is the default).
I tried to shorten your script a bit. Briefly tested, but seems to work.
If not, maybe it can give some inspiration
Quick tip: double-click speed is configurable in Windows (mouse settings). Some people might have a slow double-click speed (old / muscle troubles/..) or a fast one (pro-gamers/..).
You can read the Windows double-click speed in AHK using:
Code: Select all
$DoubleClickTime := DllCall("GetDoubleClickTime")
I tried to shorten your script a bit. Briefly tested, but seems to work.
If not, maybe it can give some inspiration
Code: Select all
; Read Doubleclick speed (system setting)
$DoubleClickTime := DllCall("GetDoubleClickTime")
#IfWinActive ahk_exe Everything64.exe
Lbutton::
{
MouseGetPos,,,, CurrentControl
if (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < $DoubleClickTime and CurrentControl = "SysTabControl321") {
Sleep 90
Send, {Mbutton}
}
else {
Send {%A_ThisHotkey%}
}
}
return
#IfWinActive
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Re: Wishlist - feature request, Double click tab to close
very nice. I'm new to ahk. haven't played with dll calls much yet least it be copy and paste. I'll try this out too.
Re: Wishlist - feature request, Double click tab to close
Right .. I assumed you were way more experiencd than I am, because I remembered you wrote this. That's 5000+ lines of code!
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Re: Wishlist - feature request, Double click tab to close
That reminds me I need to upload an update that fixes a Ctrl + space hotkey which EV implanted a in a recent update.
But still over on the reddit they were fast to say my code was messy and that I aught to double the code by rewriting in v2. Which isn't necessary for work with simple text....
Furthermore check out this dedcaited EV menu I posted last night. Pulled this out of my main script. ...
viewtopic.php?t=15972
I figured out how to copy details of the selected items from an everything window that in the background without bringing it to the front\top.
Re: Wishlist - feature request, Double click tab to close
Everything 1.5.0.1390a adds a tabs_double_click_action advanced setting.
To close tabs on double click:
Everything 1.5.0.1390a also improves middle button handling.
To close tabs on double click:
- In Everything 1.5, from the Tools menu, click Options.
- Click the Advanced tab on the left.
- To the right of Show settings containing, search for:
tabs - Select: tabs_double_click_action
- Set the value to: Close
- Click OK.
Everything 1.5.0.1390a also improves middle button handling.
-
- Posts: 14
- Joined: Fri Nov 24, 2023 12:19 am
Re: Wishlist - feature request, Double click tab to close
very nice!
this is more responsive than my ahk script.
Thank you!
this is more responsive than my ahk script.
Thank you!