Skip to content

Instantly share code, notes, and snippets.

@TaranVH
Created April 5, 2016 20:03
Show Gist options
  • Save TaranVH/84984a475d391b9ac611f700560c5279 to your computer and use it in GitHub Desktop.
Save TaranVH/84984a475d391b9ac611f700560c5279 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.
Size := 50, Color := "Red" ; 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%
sleep, 25
}
count := 0
tooltip
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
@Raxol
Copy link

Raxol commented Apr 5, 2016

I changed some things. https://gist.github.com/Raxol/ca2cee8929eb934e4cbf239d1915f6e0
Hands down.. I'm not AHK pro 😆

What excalty are you planning to do with rightclick etc?

@emarg
Copy link

emarg commented Apr 6, 2016

Here is my code thats almost finished i think its basic what you wanted.
Also im new to AHK and code is a little messy but works from what i can tell
https://gist.github.com/emarg/88646a91c9bf00a4964d5c8271a1f528

Let me know how you like it and if it works :)

-Austin

Also Sorry for bad commenting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment