tooltip toggle Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
[m]
Posts: 21
Joined: 05 May 2020, 14:12

tooltip toggle

04 Aug 2023, 19:02

I am trying to toggle the tooltip on and off via hotkey. The tooltip is at the bottom right corner when off and when on the tooltip follows the mouse. The problem is it constantly jumps back and forth when toggled. Putting the tooltip outside the SetTimer isn't ideal either as it just covers a part of the screen, this is the reason why i want it in the corner but I'm not sure how to keep it to its place when toggled on or off.

thanks in advance

Code: Select all

SetTimer, run, 0

F6:: t := !t

run:
ToolTip, ., 1920, 1150

FileDelete, C:\some\file\path
FileDelete, C:\more\folders\here
if !t 

ToolTip, .
Last edited by [m] on 04 Aug 2023, 19:48, edited 1 time in total.
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: tooltip toggle  Topic is solved

04 Aug 2023, 19:24

Something like this?

.
follow tip.gif
follow tip.gif (154.97 KiB) Viewed 361 times
.

Code: Select all

#SingleInstance, Force
CoordMode, ToolTip, Screen 
Value := 0
SetTimer, RunTip , 30
return

*ESC::ExitApp

F1::Tog := !Tog 

RunTip:
	Value++
	if( Tog ){
		ToolTip, % Value ;Follow
	}else{
		ToolTip, % Value , 200 , 200 ;Stay in a fixed position
	}
	return
User avatar
[m]
Posts: 21
Joined: 05 May 2020, 14:12

Re: tooltip toggle

04 Aug 2023, 21:40

Yes, was able to implement that into my code, thanks alot.
Hellbent wrote:
04 Aug 2023, 19:24
Something like this?

.
follow tip.gif
.

Code: Select all

#SingleInstance, Force
CoordMode, ToolTip, Screen 
Value := 0
SetTimer, RunTip , 30
return

*ESC::ExitApp

F1::Tog := !Tog 

RunTip:
	Value++
	if( Tog ){
		ToolTip, % Value ;Follow
	}else{
		ToolTip, % Value , 200 , 200 ;Stay in a fixed position
	}
	return
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: tooltip toggle

04 Aug 2023, 21:57

Np.
There is a good chance that when the tooltip is in a fixed position it doesn't need to be updated every time the timer label gets called.
You can add some logic to check if the value has changed and only then update the tip (As well as updating it when you first toggle it off to display it in it's position )

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: bobstoner289, peter_ahk and 327 guests