Skip to content

Instantly share code, notes, and snippets.

@Raxol
Forked from TaranVH/cursor click visualizer.ahk
Last active April 5, 2016 22:40
Show Gist options
  • Save Raxol/ca2cee8929eb934e4cbf239d1915f6e0 to your computer and use it in GitHub Desktop.
Save Raxol/ca2cee8929eb934e4cbf239d1915f6e0 to your computer and use it in GitHub Desktop.
show clicks visually onscreen.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetBatchLines -1 ; To make sure the script runs at max speed. That way everything looks smooth.
Size := 50, Color := "Red", StayOnTime := 150 ; settings
CoordMode, mouse, screen
Gui, -Caption +ToolWindow +AlwaysOnTop +LastFound
Gui, Color, %Color%
GuiHwnd := WinExist()
DetectHiddenWindows, On
WinSet, Transparent, 60, ahk_id %GuiHwnd%
WinSet, Region, % "0-0 W" Size " H" Size " E", ahk_id %GuiHwnd% ; An ellipse instead of a rectangle.
WinSet, ExStyle, +0x20, ahk_id %GuiHwnd% ; set click through style
Gui, Show, w%Size% h%Size% hide
Return
; ~LButton::
; MouseGetPos, MouseX, MouseY
; posX := Round(MouseX - Size/2), posY := Round(MouseY - Size/2)
; Gui, Show, x%posX% y%posY% NA
; Return
~*$LButton::
{
While Getkeystate("LButton","P")
{
MouseGetPos, MouseX, MouseY
posX := Round(MouseX - Size/2), posY := Round(MouseY - Size/2)
Gui, Show, x%posX% y%posY% NA
; count++
; tooltip, %count%
}
count := 0
tooltip
SetTimer, HideGUI, -%StayOnTime%
}
return
HideGUI:
Gui, Hide
return
; still to do
; make right click, middle, and scroll work.
; want to use ( next to the cursor for left click
; ) for right click
;^ for scroll up
;v for scroll down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment