[Feature Request] change focus to panel on mouse over

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Lolita
Junior Member
Junior Member
Posts: 5
Joined: 2006-05-17, 07:51 UTC

[Feature Request] change focus to panel on mouse over

Post by *Lolita »

Can you add feauture to change focus to left or right panel when i move mouse over it?
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

Support++! Would be awesome...
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

I didn't try it myself, but perhaps one of these mouse tools like "XMouse" will do the trick? If not, an AHK- or AutoIT-Script might help. Here is a solution with AutoIT:

Code: Select all

;====================================================================================================
;TCFocusPanelOnMouseOver.au3, van Dusen, 2006-05-17
;Script for AutoIT3 (http://www.autoitscript.com/autoit3/)
;====================================================================================================

AutoItSetOption("WinTitleMatchMode", 4)
AutoItSetOption("MouseCoordMode", 2)

$classTC = "classname=TTOTAL_CMD"
$intCurrActivePanel = 0
$intLastActivePanel = 0

While 1
	
	WinWaitActive($classTC)
	$hwndTC = WinGetHandle($classTC)
	
	$arrTMyListBox1Pos = ControlGetPos($classTC, "", "TMyListBox1")
	$arrTMyListBox2Pos = ControlGetPos($classTC, "", "TMyListBox2")
	$arrMousePos = MouseGetPos()
	
	If $arrMousePos[0] >= $arrTMyListBox1Pos[0] _
	And $arrMousePos[0] <= $arrTMyListBox1Pos[0] + $arrTMyListBox1Pos[2] _
	And $arrMousePos[1] >= $arrTMyListBox1Pos[1] _
	And $arrMousePos[1] <= $arrTMyListBox1Pos[1] + $arrTMyListBox1Pos[3] Then
		
		;*** cm_FocusRight=4002;Focus on right file list
		$intCurrActivePanel = 4002
	
	ElseIf $arrMousePos[0] >= $arrTMyListBox2Pos[0] _
	And $arrMousePos[0] <= $arrTMyListBox2Pos[0] + $arrTMyListBox2Pos[2] _
	And $arrMousePos[1] >= $arrTMyListBox2Pos[1] _
	And $arrMousePos[1] <= $arrTMyListBox2Pos[1] + $arrTMyListBox2Pos[3] Then
	
		;*** cm_FocusLeft=4001;Focus on left file list
		$intCurrActivePanel = 4001
		
	EndIf
	
	If $intCurrActivePanel <> $intLastActivePanel Then
		DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwndTC, "int", 1075, "int", $intCurrActivePanel)
		$intLastActivePanel = $intCurrActivePanel
	EndIf
		
	Sleep(250)
	
WEnd

If you don't have AutoIT installed, you can try a compiled version of this script. You can download it from here:
TCFocusPanelOnMouseOver
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

Nice script, unfortunately drag and drop are not working with this script -> error : You cannot copy a file to itself.
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

gbo wrote:Nice script, unfortunately drag and drop are not working with this script
Thanks for this warning (I didn't test the script :oops: ).
Unfortunately the script is of no earthly use without support of drag&drop... sorry :(

(EDIT: File deleted from RapidShare)
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

This is an AHK script with active drag&drop, please try and report:

Code: Select all

RegRead, DoubleClickSpeed, HKEY_CURRENT_USER, Control Panel\Mouse, DoubleClickSpeed
If NOT DoubleClickSpeed
  DoubleClickSpeed = 500

SetTimer, FocusCheck, 10    ;adjust responsiveness in milliseconds
Return

FocusCheck:
WinWaitActive, ahk_class TTOTAL_CMD
ControlGetFocus, Focus
MouseGetPos, null, null, null, HoveredControl
If (InStr(HoveredControl, "TMyListBox") AND NOT (Focus="TMyPanel5" OR Focus="TMyPanel9" OR Focus="TInEdit.UnicodeClass1" OR GetKeyState("LButton", "P") OR GetKeyState("RButton", "P")))
  ControlFocus, %HoveredControl%
Return

#IfWinActive, ahk_class TTOTAL_CMD
~LButton::
Thread, NoTimers
Sleep, %DoubleClickSpeed%
Thread, NoTimers, false
Return
Edit: fixed problems reported by gbo and StickyNomad.

Icfu
Last edited by icfu on 2006-05-18, 20:12 UTC, edited 4 times in total.
This account is for sale
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

So far, so good, AHK for ever! 8)

Thanks

Double click is not always working as expected on my PC. Sometimes it needs more than dbl click especially when switched from one panel to the other and when clicking on [..] (go to parent folder)
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Double click is not always working as expected on my PC. Sometimes it needs more than dbl click especially when switched from one panel to the other and when clicking on [..] (go to parent folder)
Recheck error corrected version above, should work perfectly or at least better now. ;)

Icfu
This account is for sale
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2icfu
should work perfectly or at least better now.
Good work! Well, after a quick test it seems the latter one is true :wink:

When slowly moving the mouse from one panel straight up to e.g. the buttonbar, the focus isn't updated correctly anymore when hovering back again over the panels. After clicking somewhere in a panel, everything behaves normal again.

This Could also be Mousedriver- or whatever-related and is no fixing request, just a hint :)
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Fixed again...

Icfu
This account is for sale
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

That was fast! :) Seems to work fine now, thanks.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Please do the following check, the script seems to have a problem I have already reported in the AHK forum:
1. Start inline renaming an arbitrary file
2. While renaming hover the rename box.

Do you get an error popup?
Error: This variable or function name contains an illegal character. The current thread will exit.

Specifically: TInEdit.UnicodeClass1
blabla...
Icfu
This account is for sale
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2icfu

Confirmed, but does not happen always...
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

I have found the problem and fixed it finally, retry please. :)

Icfu
This account is for sale
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2icfu

Did a quick check and it seems to work like a charm now, thanks. :D
Post Reply