Page 1 of 1

use mouse wheel click to open folder in new tab

Posted: 2010-02-03, 03:15 UTC
by knoeppes
great product, i love totalcmd!

how about adding the feature when you use the mouse wheel
to click on a folder to open it in a new tab?
(background/foreground is user choice), this would be similar to firefox for example.

opinions? interested to hear back.
cheers,

Posted: 2010-02-03, 05:03 UTC
by MVV
Mouse wheel click is usually used for fast scrolling.

But you may use some script to get what you want even w/o such feauture in TC directly.

Since I usually use keyboard when browsing folders in TC, I press Ctrl+Up to open focused folder in new tab. Also button with command cm_OpenNewTabBg may be added to button bar.

Posted: 2010-02-03, 05:55 UTC
by Stance
knoeppes wrote:how about adding the feature when you use the mouse wheel
to click on a folder to open it in a new tab?
(background/foreground is user choice) [...]
My support for this proposal, especially if it would be configurable. I would certainly use this feature.

Posted: 2010-02-04, 22:00 UTC
by Balderstrom
Whether or not you'll find this useful;
This is how you would do just that with AutoHotKey:

If your TC Setting/Preferences:
Folder Tabs
[ ] Ctrl+Up opens new tab in foreground
Then set
TCCtrlUpNewTabFore := 0
else, if that option is checked:
TCCtrlUpNewTabFore := 1

This should be checked (so that Ctrl+Tab Shift+Ctrl+Tab works below):
[x] Open new tabs near current tab

Code: Select all

MButtonTabForeground := 1
; There is a way to parse TC's wincmd.ini file and set this from TC's 
; actual setting, but I don't have access to my PC and AHK functions.
TCCtrlUpNewTabFore := 0

#ifWinActive ahk_class TTOTAL_CMD
{
	MButton::
	{
		KeyWait, MButton
		MouseGetPos, ,,,aControl
		if( RegExMatch( aControl, "^TMyListBox(1|2)$"))
		{
			Send, ^{Up}
			if( MButtonTabForeground && !TCCtrlUpNewTabFore )
				Send, ^{Tab}
			else
			if( !MButtonTabForeground && TCCtrlUpNewTabFore )
				Send, +^{Tab}
		}
		else
			Send, {MButton}
	return
	}
return
}

Posted: 2010-02-06, 18:38 UTC
by Stance
Balderstrom
Thanks for the effort. I have installed Autohotkey and created a AHK-Script with the code.

Your script is functional when the filelist has the focus (KatMouse?) and the directory is under the cursor. I am using different Configurations, partly with "SingleClickStart=6". Your script seems to work even in the "BreadCrumbBar", but only with directories that contain subdirectories (could have been an issue with UAC on Vista). I was running TC from USB.

Posted: 2010-02-07, 01:47 UTC
by Balderstrom
I use the "TMyListBox" and the MouseGetPos to prevent unwanted actions from occuring (when the mouse is not actually hovering over the FileList panels). This allows the Middle Mouse Button to work for possible other actions when the mouse pointer is placed on a different gui element, and for it to not occur if when the Middle button is released the mouse pointer is outside of TC's window.

To remove such, the script would possibly incur unwanted behaviour, as well as capturing the Middle Button at all times (within TC).

Code: Select all

MButtonTabForeground := 1 
TCCtrlUpNewTabFore := 0

#ifWinActive ahk_class TTOTAL_CMD 
{ 
   MButton:: 
   { 
      KeyWait, MButton 
      Send, ^{Up} 
      if( MButtonTabForeground && !TCCtrlUpNewTabFore ) 
         Send, ^{Tab} 
      else 
      if( !MButtonTabForeground && TCCtrlUpNewTabFore ) 
         Send, +^{Tab} 
   } 
return 
}

Posted: 2010-02-07, 13:28 UTC
by Stance
Balderstrom wrote:This allows the Middle Mouse Button to work for possible other actions when the mouse pointer is placed on a different gui element,[Snip...]
The Middle Mouse Button already opens a new Tab by clicking on a drive-icon in Total Commander.
The developer (or the AHK-script-author) may enhance these TC-function from drives also to directories.