Run command when mouse is at edge of screen
Run command when mouse is at edge of screen
not sure if this is possible but I would like an audio file to play when the mouse is at the far-right edge of the screen for over 300ms, reason being that is when my sidebar pops in. can this be done?
Re: Run command when mouse is at edge of screen
Code: Select all
#Persistent
placeMargin := 12, timeMargin := 300
sound = %ProgramFiles%\Microsoft Office\root\Office16\MEDIA\LYNC_ringing.wav
CoordMode, Mouse
SetTimer, Check, %timeMargin% ; Or change to 100, for example
Check:
MouseGetPos, x
last := zone, dist := A_ScreenWidth - x, zone := dist <= placeMargin
ToolTip, %dist% ; OK to delete
Switch
{
Case !zone: start =
Case !last: start := A_TickCount
Case A_TickCount - start > timeMargin:
SoundPlay, %sound%, Wait
start =
}
Return
Who is online
Users browsing this forum: Google [Bot], Marium0505 and 348 guests