Page 1 of 1

Cursor Highlighter

Posted: 17 Jul 2020, 05:28
by lblb
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.

Re: Cursor Highlighter

Posted: 17 Jul 2020, 07:13
by daywalker
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.

Re: Cursor Highlighter

Posted: 19 Jul 2020, 04:05
by lblb
@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.

Re: Cursor Highlighter

Posted: 21 Jul 2020, 22:00
by gibbons6546
Thanks for this!

Re: Cursor Highlighter

Posted: 27 Jul 2020, 18:49
by lblb
@gibbons6546
I'm glad you like it!

Re: Cursor Highlighter

Posted: 27 Jul 2020, 18:50
by lblb
Updated to version 2.2.
See top post for changelog. Now with a short video to showcase the main features of the script.

Re: Cursor Highlighter

Posted: 07 Aug 2020, 18:38
by JTG
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?

Re: Cursor Highlighter

Posted: 07 Aug 2020, 23:11
by lblb
@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.

Re: Cursor Highlighter

Posted: 16 Aug 2020, 17:34
by lblb
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):


Re: Cursor Highlighter

Posted: 26 Nov 2020, 14:08
by jbroceno
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 

Re: Cursor Highlighter

Posted: 05 Dec 2020, 20:27
by lblb
@jbroceno

Sorry for the late reply. I'm glad you like the script! And it's awesome that you were able to fix it for your needs. The remote semester has been very time-consuming and I haven't had a chance to go back and revisit the script. I'll look more into what you wrote when I have more time on my hands.

Your solution works well! Just so you know, it does have an issue that was mentioned many times on this forum where the cursor tracking methods don't work well on multiple monitors with different resolutions and sizes. But if it fits for your needs, it's great!

Cheers!

Re: Cursor Highlighter

Posted: 07 Dec 2020, 06:26
by jbroceno
Hi, I'm just a newbie on ahk. Thanks for the tip, I will search about the issue. Anyhow I've not found any problem working with the patch for the meantime.

Great job, congrats!

Jesus.

Re: Cursor Highlighter

Posted: 07 Dec 2020, 12:59
by lblb
@jbroceno
No need to search for the issue, I know how to solve it but I just haven't had time to update the script. As long as your patch works for your needs, you should be good!
Have fun using it!