Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance
Persistent
#HotIf WinActive('ahk_exe paintdotnet.exe')
F4::
{
MouseGetPos &xpos, &ypos
Click 1147, 622 ; Negro
MouseMove xpos, ypos
}
F5::
{
MouseGetPos &xpos, &ypos
Click 1196, 622 ; Naranja
MouseMove xpos, ypos
}
F6::
{
MouseGetPos &xpos, &ypos
Click 1244, 622 ; Celeste
MouseMove xpos, ypos
}
F7::
{
MouseGetPos &xpos, &ypos
Click 1185, 622 ; Rojo
MouseMove xpos, ypos
}
F8::
{
MouseGetPos &xpos, &ypos
Click 1172, 622 ; Gris
MouseMove xpos, ypos
}
F9::
{
MouseGetPos &xpos, &ypos
Click 1208, 622 ; Amarillo
MouseMove xpos, ypos
}
F10::
{
MouseGetPos &xpos, &ypos
Click 1232, 622 ; Verde
MouseMove xpos, ypos
}
F11::
{
MouseGetPos &xpos, &ypos
Click 1256, 622 ; Azul
MouseMove xpos, ypos
}
F12::
{
MouseGetPos &xpos, &ypos
Click 1268, 622 ; Violeta
MouseMove xpos, ypos
}
[/url]
I have the following problem: When using stylus and tablet, pressing a key to select the color draws a straight line from the stylus position to where AHK clicks. This occurs without the stylus being in contact with the tablet. I even moved the stylus 1.5 cm = 0.6 inches away from the tablet, and the line is drawn.
If I replace the stylus with the mouse and type F4/F12 to select the color, the straight line is not drawn. That's why I think it may be some problem with the stylus or the tablet, because it started happening a few days ago. I changed the stylus lead because it was worn out, but the problem didn't solve.
I've been using this AHK script for months. I added BlockInput to the script (I don't know if correctly), but it didn't fix the problem.
Is there a way to modify the script so that that straight line is not drawn? Thank you so much.