Skip to content

feat: add mouseModifiers parameter to setupLocatorUI - #192

Draft
Strajk wants to merge 1 commit into
infi-pc:masterfrom
Strajk:feat/mouse-modifiers-param
Draft

feat: add mouseModifiers parameter to setupLocatorUI#192
Strajk wants to merge 1 commit into
infi-pc:masterfrom
Strajk:feat/mouse-modifiers-param

Conversation

@Strajk

@Strajk Strajk commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

Summary

Adds a mouseModifiers parameter to the setupLocatorUI() function, allowing users to configure custom keyboard shortcuts when using Locator without the browser extension.

Changes

  • Added mouseModifiers?: string parameter to setup() function in packages/runtime/src/index.ts
  • Updated initRuntime() to accept and set the mouse modifiers via document.documentElement.dataset.locatorMouseModifiers
  • Maintains full backward compatibility (defaults to 'alt' if not specified)

Usage

import setupLocatorUI from '@locator/runtime'

if (process?.env?.NODE_ENV === 'development') {
  setupLocatorUI({ 
    adapter: 'jsx',
    mouseModifiers: 'meta+shift' // Cmd+Shift+Click instead of Option+Click
  })
}

Available Options

  • 'alt' - Option/Alt + Click (default)
  • 'meta' - Cmd/Windows + Click
  • 'shift' - Shift + Click
  • 'ctrl' - Ctrl + Click
  • 'meta+shift' - Cmd+Shift + Click
  • 'meta+alt' - Cmd+Option + Click
  • Any combination of alt, ctrl, meta, shift joined by +

Motivation

This feature parity with the browser extension allows users who manually inject the Locator UI to customize keyboard shortcuts according to their preferences, avoiding conflicts with other tools or personal workflow preferences.

- Add mouseModifiers option to setup() function
- Allow configuring keyboard shortcuts (e.g., 'meta+shift' for Cmd+Shift+Click)
- Maintains backward compatibility (defaults to 'alt' if not specified)
- Supports any combination of alt, ctrl, meta, shift modifiers
@vercel

vercel Bot commented Nov 17, 2025

Copy link
Copy Markdown

@Strajk is attempting to deploy a commit to the Michael Musil's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant