Jump to content

Search the Community

Showing results for tags 'mouse cursor locate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Every now and then I come back to my two big monitors and I can't find the mouse cursor. I'm moving the mouse around but don't seem to be looking in the right place or the right screen. In a few seconds I feel like and idiot and it is very irritating. So finally I wrote a program that waits for 5 minutes of idletime (no keyboard or mouse movement) and draws a nice red circle around the mouse cursor. That I can spot easily, even from across the room as I walk up to the computer. It works nicely coming back from sleep mode if I press a key. If I moved the mouse to come out of sleep I can press the middle mouse button to show the red ring. As soon as I move the mouse it disappears. It has a tray menu so you can change the amount of idletime before it turns on and there is another menu choice to Exit. You can compile the script and set a link in your start menu to come on every day if you like it. I'm attaching a circle icon for the taskbar icon and the exe icon in case want to use it. Thanks to Bam and martin for the circle code using window regions ;circle around mouse cursor #AutoIt3Wrapper_Icon=circle2.ico #NoTrayIcon #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <timers.au3> #include <misc.au3> ;Thanks to Bam and martin for the circle code using window regions https://www.autoitscript.com/forum/topic/85970-draw-a-circle-around-the-mouse/ Global $IdleTime = 5 * 60000 ;change the 5 to the number of minutes before circle appears Opt("TrayMenuMode", 3) ;The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode. Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu TraySetToolTip("ms-circle") TrayCreateItem("SetTime") TrayItemSetOnEvent(-1, "__SetTime") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_bye") TraySetIcon("circle2.ico") TraySetState() $iCircleR = 20 ; <=== Edit this for different circle radius (in pixels) $iCircleD = $iCircleR * 2 $pt = MouseGetPos() $GUI = GUICreate("test", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xFF0000) $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4)) _CombineRgn($a, $b) _SetWindowRgn($GUI, $a) GUISetState(@SW_HIDE) While 1 Sleep(250) _chk_Idle() WEnd ;*** Functions *** Func _CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc ;==>_CreateRoundRectRgn Func _CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc ;==>_CombineRgn Func _SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>_SetWindowRgn Func __SetTime() Local $sd, $min $sd = "Number of minutes" $min = InputBox("Now " & $IdleTime / 60000 & " minutes", $sd, "", "", -1, 122 + (13.2 * UBound(StringRegExp($sd, '\R', 3)))) if $min > 0 then $IdleTime = $min * 60000 EndFunc ;==>__SetTime Func _bye() ToolTip("Exiting") Sleep(1000) ToolTip("", 500, 300) Exit EndFunc ;==>_bye Func _chk_Idle() If _Timer_GetIdleTime() > $IdleTime Or _IsPressed(04) Then ;1 minutes idle Local $wh = WinGetHandle("[active]") $pt = MouseGetPos() GUISetState() GUISetState(@SW_DISABLE) If Not @error Then WinMove($GUI, "", $pt[0] - $iCircleR, $pt[1] - $iCircleR) WinActivate($wh) While 1 $ap = MouseGetPos() If $ap[0] <> $pt[0] Then ExitLoop EndIf Sleep(1000) WEnd GUISetState(@SW_HIDE) EndIf EndFunc ;==>_chk_Idle circle2.ico
×
×
  • Create New...