The problem only happens when using WinTab. I added the following to PSUserConfig.txt
# Use WinTab
UseSystemStylus 0
Here is my test script. It will show a white block near the cursor. I've set SetBatchLines, -1
so it's almost in real-time. However, it causes Photoshop's second stroke to lag.
#SingleInstance, force
SetBatchLines, -1
Coordmode, Mouse, Screen
Gui, PresCursor: -caption +ToolWindow +AlwaysOnTop +E0x20 +LastFound
hGui_Cursor := WinExist()
Loop
{
MouseGetPos,CurrentX,CurrentY
Gui, PresCursor: Show, % "x" CurrentX-30 "y" CurrentY-30 " w" 10 " h" 10 " NoActivate"
Winset, AlwaysOnTop, ON, ahk_id %hGui_Cursor%
}
The second stroke is lagging, but the cursor is not. To solve it, I tried to set the CPU priority and process affinity, but neither worked. I checked the Task Manager and found that my AHK script was only using one CPU core. So I don't know why it can cause Photoshop to lag. I also tried other programs like Clip Studio Paint and Paint Tool SAI. They don't have the same problem when using WinTab.
I have tested it many times. Only the second stroke lags. The first stroke doesn't lag even when I draw a very fast and long stroke. So I don't know what is going on here. It seems like my AHK script makes Photoshop need to "take a breath" between two strokes. It's weird.