Tab wheel scroll functionality.

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

could you please modify the code to make it similar to the one in the 1st post, so it will run totalcommander's process and monitor if it's alive, and if not - then suicide? please, I want this script to be run with total commander and be shut down when total is dead.
+ tell me how to disable showing script icon in the tray?
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

Could anyone please help me with that?
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

Btw, I've noticed a small half-bug: if scrolling inactive panel too fast - then it sometimes scrolls the active panel, just because the focus doesn't go back in time. And even visually you can see that when you scroll inactive panel it sometimes gets activated. Is it fixable?
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

could you please modify the code to make it similar to the one in the 1st post, so it will run totalcommander's process and monitor if it's alive, and if not - then suicide? please, I want this script to be run with total commander and be shut down when total is dead.
The first Post doesn't check such things.
To do so add this lines after "SendMode Input":

Code: Select all

if(not WinExist("ahk_class TTOTAL_CMD")){
 run C:\Program Files\totalcmd\totalcmd.exe
}
settimer,CloseTC,1000
return

CloseTC:
if(not WinExist("ahk_class TTOTAL_CMD")){
 ExitApp
}
return

+ tell me how to disable showing script icon in the tray?
Add this line at the beginning:

Code: Select all

#NoTrayIcon

Btw, I've noticed a small half-bug: if scrolling inactive panel too fast - then it sometimes scrolls the active panel, just because the focus doesn't go back in time.
You may try to add delays between the PostMessages: (Play with the values behind "sleep")

Code: Select all

if( panelCheck )
   {
      PostMessage, 0x433, pane1
      sleep,200
      PostMessage, 0x433, cmd
      sleep,200
      PostMessage, 0x433, pane2
      sleep,200
   }
   else
      PostMessage, 0x433, cmd
return 

And even visually you can see that when you scroll inactive panel it sometimes gets activated. Is it fixable?
No, you have to activate it to make the scrolling possible. Because you can never scroll tabs in inactive panels.

I would suggest to remove this line: "PostMessage, 0x433, pane2"
Then a inactive panel gets active on scrolling its tab. Perhaps this will solve it.



PS: You should learn AHK on your own.
fux
Junior Member
Junior Member
Posts: 2
Joined: 2018-12-23, 22:30 UTC

Re: Tab wheel scroll functionality.

Post by *fux »

Hi all,

this post is already quite old though it's exactly about what I need too. Hopefully, someone is able to help.

I tried the AHK script on Page 1 from Balderstrom (viewtopic.php?p=189160#p189160) but it didn't do anything. I am Not sure if it's because of a different setup? Mine: Win 10/Tcmd 9.51.

I edited the script a little and it works now except one thing. The scrolling is windows wide. Means, if I use the mouse wheel to scroll through the content of a folder it scrolls through that tabs instead. Is there a way to limit the focus just to the tab bar for browsing through it?

Help is very appreciated

Code: Select all

; https://ghisler.ch/board/viewtopic.php?t=24301

; #NoTrayIcon

#InstallMouseHook
#SingleInstance, Force 
SetBatchLInes, -1
SendMode Input

TCTabScroll( key, panelCheck, pane1, pane2 )
{
	cmd := (key == "WheelUp" ? 3006 : 3005)
	if( panelCheck )
	{
		PostMessage, 0x433, pane1
		PostMessage, 0x433, cmd
		PostMessage, 0x433, pane2
	}
	else
		PostMessage, 0x433, cmd
return
}

#ifWinActive, ahk_class TTOTAL_CMD
{
	WheelUP::
	;WheelRight::
	{
		ControlGetFocus, aControl, ahk_class TTOTAL_CMD
		MouseGetPos, ,,, mControl

		if( mControl == "TMyTabControl2" || mControl == "TMyPanel7" )	; RIGHT
			TCTabScroll( A_ThisHotkey, (aControl != "TMyListBox1"), 4002, 4001 )
		else
		if( mControl == "TMyTabControl1" || mControl == "TMyPanel4" )	; LEFT
			TCTabScroll( A_ThisHotkey, (aControl != "TMyListBox2"), 4001, 4002 )
		else
			Send, {Ctrl Down}{Tab}{Ctrl Up}
	return
	}
	
	WheelDown::
	;WheelLeft::
	{
		ControlGetFocus, aControl, ahk_class TTOTAL_CMD
		MouseGetPos, ,,, mControl

		if( mControl == "TMyTabControl2" || mControl == "TMyPanel7" )	; RIGHT
			TCTabScroll( A_ThisHotkey, (aControl != "TMyListBox1"), 4002, 4001 )
		else
		if( mControl == "TMyTabControl1" || mControl == "TMyPanel4" )	; LEFT
			TCTabScroll( A_ThisHotkey, (aControl != "TMyListBox2"), 4001, 4002 )
		else
			Send, {Ctrl Down}{Shift Down}{Tab}{Shift Up}{Ctrl Up}
	return
	}
	
return
}
Post Reply