I compared how ToolTipEx and ToolTipX performed and found out that the former causes delays when called repeatedly, while the latter immediately updates the tooltip text, although the timeout is affected (it is not reset and gets reduced). Can you look into this?
Here's a script in which I am using ToolTipEx:
Code: Select all
#requires AutoHotkey v2.0
#include <toolTipEX>
cycleNumber := 1
#c:: {
global cycleNumber
if (cycleNumber == 1)
setTimer(cycleReset , -5000)
caseConverter(mod(cycleNumber , 3))
cycleNumber++
setTimer(cycleReset)
}
caseConverter(caseNumber){
; release all keys if issue arises
selection := getSelectedText() , selectionLength := strlen(selection)
switch caseNumber {
case 1: ; CONVERT CLIPBOARD TO UPPER CASE
send(Format("{:U}" , selection))
toolTipEX("UPPER CASE" , 2)
case 2: ; Convert Clipboard To Title Case
send(Format("{:T}" , selection))
toolTipEX("Title Case" , 2)
default: ; convert clipboard to lower case
send(Format("{:L}" , selection))
toolTipEX("small case" , 2)
}
send("{Shift down}{left " selectionLength "}{Shift up}") ; Highlight text
return
}
cycleReset() {
global cycleNumber
cycleNumber := 1
setTimer( , 0)
toolTipEX("cycleNumber reset!" , 2)
return
}
getSelectedText() {
originalClipboard := ClipboardAll()
a_Clipboard := ""
sendEvent("{Ctrl down}{c}{Ctrl up}")
clipWait()
selectedText := a_Clipboard , a_Clipboard := originalClipboard , originalClipboard := ""
return selectedText
}