Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

This PR adds a new configurable shortcut to switch between spotlight and circle highlight modes in Mouse Highlighter, allowing users to quickly change modes without opening the settings panel.

Changes Made

Backend Implementation (C++)

  • Added MouseHighlighterSwitchMode() API function that toggles the spotlight mode setting
  • Implemented WM_SWITCH_HIGHLIGHT_MODE message handling to restart drawing with the new mode
  • Updated the module interface from single hotkey (GetHotkeyEx) to multiple hotkeys (get_hotkeys) to support both activation and mode switch shortcuts
  • Added proper parsing for the new mode switch shortcut in settings configuration

Settings & UI (C#)

  • Added ModeSwitchShortcut property to MouseHighlighterProperties.cs with default Win+Shift+M binding
  • Updated MouseUtilsViewModel.cs to expose the new shortcut property and include it in hotkey conflict detection
  • Added UI control in MouseUtilsPage.xaml for configuring the mode switch shortcut
  • Added localization strings for the new feature

User Experience

Before: Users had to open PowerToys Settings → Mouse utilities → Mouse Highlighter and toggle the "Spotlight mode" checkbox to switch between highlighting modes.

After: Users can now:

  • Use Win+Shift+H to toggle Mouse Highlighter on/off (existing functionality)
  • Use Win+Shift+M to instantly switch between Circle and Spotlight modes (new functionality)
  • Configure both shortcuts independently in the settings UI
  • Switch modes only when Mouse Highlighter is active

Technical Details

The implementation follows established PowerToys patterns for multi-hotkey modules and maintains backward compatibility. The mode switching works by:

  1. Detecting the hotkey via the centralized keyboard hook
  2. Calling the new MouseHighlighterSwitchMode() function
  3. Toggling the internal m_spotlightMode flag
  4. Restarting the drawing system with the new mode if currently active

This provides instant visual feedback when switching between circle highlights (for mouse clicks) and spotlight mode (continuous mouse following).

Fixes #41565.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI assigned Copilot and vanzue Sep 4, 2025
Copy link
Contributor Author

Copilot AI commented Sep 4, 2025

@vanzue 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] [Mouse Highlighter] Add shortcut to switch between highlight modes [Mouse Highlighter] Add shortcut to switch between highlight modes Sep 4, 2025
@Copilot Copilot AI requested a review from vanzue September 4, 2025 01:21
Copilot finished work on behalf of vanzue September 4, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mouse Highlighter] Add shortcut to switch between highlight modes
2 participants