doc/dsc/modules/MousePointerCrosshairs.md
Manages configuration for the Mouse Pointer Crosshairs utility, which displays crosshairs centered on your mouse pointer.
The MousePointerCrosshairs module configures PowerToys Mouse Pointer
Crosshairs, a utility that displays customizable crosshairs overlaid on your
screen, centered on the mouse cursor. This is useful for presentations,
design work, or improving cursor visibility.
The MousePointerCrosshairs module supports the following configurable properties:
Sets the keyboard shortcut to toggle crosshairs display.
Type: object
Properties:
win (boolean) - Windows key modifierctrl (boolean) - Ctrl key modifieralt (boolean) - Alt key modifiershift (boolean) - Shift key modifiercode (integer) - Virtual key codekey (string) - Key nameDefault: Win+Alt+P
Sets the color of the crosshairs.
Type: string (hex color)
Format: "#RRGGBB"
Default: "#FF0000" (red)
Sets the opacity of the crosshairs (0-100).
Type: integer
Range: 0 to 100
Default: 75
Sets the length of the crosshair lines in pixels.
Type: integer
Range: 0 to 9999
Default: 100
Sets the thickness of the crosshair lines in pixels.
Type: integer
Range: 1 to 50
Default: 5
Sets the border color of the crosshairs.
Type: string (hex color)
Format: "#RRGGBB"
Default: "#FFFFFF" (white)
Sets the width of the crosshair border in pixels.
Type: integer
Range: 0 to 50
Default: 1
Controls whether crosshairs automatically hide when the mouse is not moving.
Type: boolean
Default: false
Controls whether crosshairs have a fixed length or extend to screen edges.
Type: boolean
Default: true
Sets the fixed length of crosshairs when fixed length mode is enabled.
Type: integer
Range: 0 to 9999
Default: 100
This example customizes the crosshair color and size.
$config = @{
settings = @{
properties = @{
CrosshairsColor = "#00FF00"
CrosshairsOpacity = 85
CrosshairsThickness = 3
CrosshairsRadius = 150
}
name = "MousePointerCrosshairs"
version = "1.0"
}
} | ConvertTo-Json -Depth 10 -Compress
PowerToys.DSC.exe set --resource 'settings' --module MousePointerCrosshairs `
--input $config
This example adds a border to the crosshairs for better visibility.
dsc config set --file mousecrosshairs-border.dsc.yaml
# mousecrosshairs-border.dsc.yaml
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Configure crosshairs with border
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
properties:
settings:
properties:
CrosshairsColor: "#FF0000"
CrosshairsBorderColor: "#FFFFFF"
CrosshairsBorderSize: 2
CrosshairsThickness: 4
name: MousePointerCrosshairs
version: 1.0
This example installs PowerToys and configures crosshairs for presentations.
winget configure winget-mousecrosshairs.yaml
# winget-mousecrosshairs.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
metadata:
winget:
processor: dscv3
resources:
- name: Install PowerToys
type: Microsoft.WinGet.DSC/WinGetPackage
properties:
id: Microsoft.PowerToys
source: winget
- name: Configure Mouse Crosshairs
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
properties:
settings:
properties:
CrosshairsColor: "#FFFF00"
CrosshairsOpacity: 90
CrosshairsRadius: 120
CrosshairsThickness: 5
CrosshairsBorderSize: 2
name: MousePointerCrosshairs
version: 1.0
This example configures crosshairs that extend to screen edges.
dsc config set --file mousecrosshairs-fullscreen.dsc.yaml
# mousecrosshairs-fullscreen.dsc.yaml
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Full-screen crosshairs
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
properties:
settings:
properties:
CrosshairsIsFixedLengthEnabled: false
CrosshairsOpacity: 60
name: MousePointerCrosshairs
version: 1.0
This example creates subtle crosshairs that hide when idle.
$config = @{
settings = @{
properties = @{
CrosshairsColor = "#FFFFFF"
CrosshairsOpacity = 50
CrosshairsThickness = 2
CrosshairsRadius = 80
CrosshairsAutoHide = $true
}
name = "MousePointerCrosshairs"
version = "1.0"
}
} | ConvertTo-Json -Depth 10 -Compress
PowerToys.DSC.exe set --resource 'settings' --module MousePointerCrosshairs --input $config
Configure for clear cursor tracking during presentations:
resources:
- name: Presentation crosshairs
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
properties:
settings:
properties:
CrosshairsColor: "#FFFF00"
CrosshairsOpacity: 85
CrosshairsRadius: 150
name: MousePointerCrosshairs
version: 1.0
Configure for precise alignment work:
resources:
- name: Design crosshairs
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
properties:
settings:
properties:
CrosshairsIsFixedLengthEnabled: false
CrosshairsThickness: 1
CrosshairsOpacity: 70
name: MousePointerCrosshairs
version: 1.0