Cursor Highlighter

Post your working scripts, libraries and tools
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Cursor Highlighter

17 Jul 2020, 05:28

Last update: v. 2.2, July 27, 2020
(Previous update: v. 2.1, July 19, 2020)

Cursor Highlighter is a program that makes the mouse cursor easier to track. There are three modes: the basic function is to create a colored "halo" around the mouse cursor. It can also be set to instead have a user-defined icon follow the mouse cursor, or to act as a "cursor focus" where the screen is darkened except for a circle around the mouse cursor. The program can be useful to make the mouse cursor more obvious for example during online lectures, or when recording tutorial videos, or when people with vision disabilities need to use a computer. You can switch between the three modes by using the tray icon or hotkeys, or on the first tab of the Settings.

Here is a great video by Kevin Stratvert that highlights the program (see around the 7:55 mark)



Here is a short demo video I had previously prepared:



To use the program, you can just download the .ahk file from the following Google Drive link:

DOWNLOAD THE CURRENT VERSION: Version 2.2, uploaded July 27, 2020: https://drive.google.com/file/d/1KntxXI_hhi69G0mQ4KV-6kx3ZiaKdbc1/view

The first time you run the script, it will ask you to create a .ini settings file that will contain all the settings for the program.

The program was designed to be highly customizable by the user. The settings are saved in the .ini file that has to be kept in the same folder as the .ahk script. Basically, almost everything (such as the size and color of the highlight, to the hotkeys used to switch between different functions, to the tray icon click behavior) can be customized. To change the program's settings, you can access the settings window by right-clicking on the program's tray icon.

Let me know if you have any comments, bug reports, or suggestions for improvements!

---------------------------------------------------------------------------------------------------------------------------

Notes:

- The code for the main function to highlight the cursor is actually just a few lines. The great majority of the script's code is for the GUI to allow for the users to customize the program's settings. And because the script is designed to be used by people who don't have much familiarity with AutoHotkey, all the necessary functions and libraries have been pasted into the script (so there is no need to download or #Include any external libraries).

- I'd love to make the source code directly available here, but the source code has too many characters to be accepted here (because the icons and images were included in the script as very long hBITMAP codes using Image2Include.ahk). But let me know if you're not comfortable downloading the script from the Google Drive link above!

---------------------------------------------------------------------------------------------------------------------------
All versions:

- Version 2.2, uploaded July 27, 2020: https://drive.google.com/open?id=1KntxXI_hhi69G0mQ4KV-6kx3ZiaKdbc1
Changelog:
- The demo video above was created.
- Corrected a bug in the color selection code.

- Version 2.1, uploaded July 19, 2020: https://drive.google.com/file/d/1YUCwbaqBTEfGBDfZWLTFdJXM4p7WoSO8/view?usp=sharing
Changelog:
- Added a verification for the presence of the .ini settings file in the script's folder. Thanks daywalker for the suggestion.
- On first use, a .ini file for the settings will be created. So no need to download the ini file anymore.
- Added tray menu option to switch between different cursor options.


- Version 2.0, uploaded July 17, 2020: https://drive.google.com/file/d/1l-ZT8kNjzQM5-FzvJER85ewhdlRoEyS4/view?usp=sharing
- Many, many changes have been made since v. 1.0!
- The program now has better compatibility when using multiple monitors of different resolutions.
- There are now three modes to make the cursor more obvious (colored "halo", picture, and cursor "focus").
- The Settings window now includes extensive customization options for about everything in the program.
- The cursor highlight can now be set to show something different on left- and right-clicks.
- Hotkeys can be defined to switch between the modes and to show/hide the cursor highlight.
Last edited by lblb on 16 Aug 2020, 17:32, edited 10 times in total.
daywalker
Posts: 16
Joined: 18 Jun 2019, 01:37

Re: Cursor Highlighter

17 Jul 2020, 07:13

Nice work, only one point: when .ini file is not found (crashed network etc) script stops at line#95 . Maybe a Fileexist() check before would handle this problem.
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Re: Cursor Highlighter

19 Jul 2020, 04:05

@daywalker

I'm glad you like it!

Thanks for the suggestion. I just uploaded version 2.1 in which I added a Fileexist check for the .ini file. Hopefully this will make the script more user-friendly.
gibbons6546
Posts: 21
Joined: 07 Apr 2020, 11:53

Re: Cursor Highlighter

21 Jul 2020, 22:00

Thanks for this!
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Re: Cursor Highlighter

27 Jul 2020, 18:49

@gibbons6546
I'm glad you like it!
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Re: Cursor Highlighter

27 Jul 2020, 18:50

Updated to version 2.2.
See top post for changelog. Now with a short video to showcase the main features of the script.
JTG
Posts: 1
Joined: 07 Aug 2020, 18:33

Re: Cursor Highlighter

07 Aug 2020, 18:38

Amazing little tool and VERY helpful in just the first day.
THANKS.
One quick mention: The Highlight Cursor and Picture Cursor both move between 2 screens seamlessly, however, the Focus cursor ONLY works on one monitor. Ideas to resolve?
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Re: Cursor Highlighter

07 Aug 2020, 23:11

@JTG

I'm glad you like it!

Somehow, I think I actually didn't test the cursor focus on a multi monitor setup. Thanks for reporting the issue, I'll look into it the next time I'm on my computer.
lblb
Posts: 150
Joined: 30 Sep 2013, 11:31

Re: Cursor Highlighter

16 Aug 2020, 17:34

Update to top post: Cursor Highlighter was discussed by Kevin Stratvert on his YouTube channel. A link to his video was added to the top post, and is repeated below (see at the 7:55 mark for a discussion of the program):

jbroceno
Posts: 1
Joined: 26 Nov 2020, 13:44

Re: Cursor Highlighter

26 Nov 2020, 14:08

JTG wrote:
07 Aug 2020, 18:38
Amazing little tool and VERY helpful in just the first day.
THANKS.
One quick mention: The Highlight Cursor and Picture Cursor both move between 2 screens seamlessly, however, the Focus cursor ONLY works on one monitor. Ideas to resolve?
Hi there, I love this tool. I've found the same issue and I needed to solve it (I manage a three monitors desktop) so let's do it. It took me a while reading the technical manual and testing but I eventually get it working.

You must edit two routines (Cursor Highlighter 2.2.ahk)

1) Routine "Crete_Focus"

On line 1605

Code: Select all

Create_Focus:
Gui, Focus: Margin , 0, 0
Gui, Focus: -Caption +AlwaysOnTop +E0x20 +LastFound +ToolWindow
Gui, Focus: Color, %General_Color_Cursor_Focus%
Gui, Focus: Show, Maximize, Mouse Spotlight
WinGetPos, , , w, h, Mouse Spotlight ahk_class AutoHotkeyGUI
WinGet, ID, ID, Mouse Spotlight ahk_class AutoHotkeyGUI
WinSet, Transparent, %General_Cursor_Opacity_Focus%, Mouse Spotlight
Return
The "Gui, Focus: Show" affects only to main monitor. To work on full desktop you you must compute position and dimmension of the VirtualScreen. The routine will look like this

Code: Select all

Create_Focus:
Gui, Focus: Margin , 0, 0
Gui, Focus: -Caption +AlwaysOnTop +E0x20 +LastFound +ToolWindow
Gui, Focus: Color, %General_Color_Cursor_Focus%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Working only on main monitor
; Gui, Focus: Show, Maximize, Mouse Spotlight
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Working on all monitors
SysGet, VirtualScreenX, 76
SysGet, VirtualScreenY, 77
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
Gui, Focus: Show,x%VirtualScreenX% y%VirtualScreenY% h%VirtualScreenHeight% w%VirtualScreenWidth%, Mouse Spotlight
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WinGetPos, , , w, h, Mouse Spotlight ahk_class AutoHotkeyGUI
WinGet, ID, ID, Mouse Spotlight ahk_class AutoHotkeyGUI
WinSet, Transparent, %General_Cursor_Opacity_Focus%, Mouse Spotlight
Return
2) Routine "Cut"

On line 1615

Code: Select all

Cut:
CoordMode, Mouse, Screen
MousegetPos, X1, Y1
Winset, Region, % RegionNotEllipse( w, h, X1, Y1, General_Cursor_Width_Focus/2, General_Cursor_Height_Focus/2, General_Focus_Resolution ), Mouse Spotlight ahk_class AutoHotkeyGUI
Return 
X1 and Y1 must be compensated by the top, left coordinates on virtual desktop. It will look like this

Code: Select all

Cut:
CoordMode, Mouse, Screen
MousegetPos, X1, Y1
X1 := X1 - VirtualScreenX
Y1 := Y1 - VirtualScreenY
Winset, Region, % RegionNotEllipse( w, h, X1, Y1, General_Cursor_Width_Focus/2, General_Cursor_Height_Focus/2, General_Focus_Resolution ), Mouse Spotlight ahk_class AutoHotkeyGUI
Return 

Return to “Scripts and Functions”

Who is online

Users browsing this forum: blue83, faust7th, hasantr and 20 guests