Powershell function to allow changing mouse cursor attributes in Windows 10.
Sets the mouse speed, cursor scheme, mouse trails, scroll lines and sonar (helps to fins the pointer on pressing the ctrl
key) via the SystemParametersInfo
and stores the values in the registry. Note: Still very much a work in progress (look at the todo list), but most things work
An integer between 1
(slowest) and 20
(fastest).
An integer between -1 (slowest) and 100 (fastest).
Turns on Mouse Trails
An integer between 2 (shortest) and 15 (longest) for length of the trail (in number of cursosrs to see)
Turns on Mouse Sonar (so you can find the cursor by pressing the ctrl key)
The name of the Cursor Scheme to use (validated against default windows schemes listed in registry, tab-completion supported)
An integer between 1 (smallest) and 15 (largest) representing the cursor size to use NOTE: Not working YET
PS C:> Set-Mouse -Speed 10
PS C:> Set-Mouse -ScrollLines 5
PS C:> `Set-Mouse -MouseTrailsOn -MouseTrailsLength 15
PS C:> `Set-Mouse -MouseSonarOn
- https://msdn.microsoft.com/en-us/library/ms724947(v=VS.85).aspx
- https://github.com/raevilman/windows-scripts/edit/master/mouse/speed/ps_scripts/MouseSpeed.ps1
- https://www.strichnet.com/edit-and-apply-registry-settings-via-powershell/
- http://thecomputermanagersden.blogspot.com/2014/05/powershell-script-to-customize-windows.html
- https://devblogs.microsoft.com/scripting/use-powershell-to-change-the-mouse-pointer-scheme/
- https://stackoverflow.com/questions/60104778/change-and-update-the-size-of-the-cursor-in-windows-10-via-powershell
- https://stackoverflow.com/questions/41713827/programmatically-change-custom-mouse-cursor-in-windows
- https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/writing-registry-key-default-values
- https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7
- Investigate
UserPreferences
more - Add
-SonarOff
and-TrailsOff
switches - Add more examples
- Allow choosing User Defined Cursor Schemes (
scheme source
other than 0) -
-ScrollLines
doesn't appear to work until you change windows, display a warning - Add authour information, etc
- For gods sake, COMMENT YOUR CODE!!!!
- Do something with the
Get-Mouse
function - Stop the system call displaying
True
/False
(either| Out-Null
or check it and do error handling). Although be aware that callingSPI_SETCURSOR
with bothSendChange
andUpdateIniFile
set will returnfalse
but still work (well apart from the cursor size). Selecting only one of them will returntrue
, so not holding out for much there. - Why won't
-CursorSize
work?- Just noticed, cursors set using Ease of Access in Settings actually have a
_eoa
suffix and are in%LocalAppData%\Microsoft\Windows\Cursors
instead of%WinDir%\Cursors
, they also have modified times of only a few hours ago. Could they be dynamically generated by Ease of Access when you select the size (it would explain the delay) - Add
-UseEOACursors
option to use the_eoa.cur files
. No handy registry entry with a list of these files though, so you will have to manually create a seperateCURSOR_NAMES
array (has more cursors) and hard-code the filename (they are in%LocalAppData%\Microsoft\Windows\Cursors
)
- Just noticed, cursors set using Ease of Access in Settings actually have a
- Find a way to not hard-code the
CURSOR_NAMES
array - When writing pairs to registry in
-CursorScheme
, do a check to make sure the two arrays are the same size. I'm not doing it now just for ease of debugging surprisingly - Change the number of elements to remove from the end of the initial
SchemeFiles
array to a constant - Create an option to set Text Indicator:
- Reg Location:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Accessibility\CursorIndicator
- Set Colour Key:
IndicatorColor
(RGB Hex nice purple is0xff00bf
) - Set size Key:
IndicatorType
(anint
1
-5
)
- Reg Location:
- Create a
Set-Font
function to set windows font sizes and weights for Window Titles, Status Bars, Menus, Icons, Messages, etc