Skip to content

Add configurable global hotkeys - #298

Draft
mardausdennis wants to merge 2 commits into
overlayeddev:mainfrom
mardausdennis:201_global-shortcuts
Draft

mardausdennis wants to merge 2 commits into
overlayeddev:mainfrom
mardausdennis:201_global-shortcuts

Conversation

@mardausdennis

Copy link
Copy Markdown
Contributor

Related to #201. Builds on #297, so the first commit here is that PR. I'll rebase once it's in.

This adds global hotkeys that work while a game has focus. There are four commands: lock/unlock the overlay (pin), show/hide it, move a fixed overlay to the next monitor, and open settings. Defaults are Ctrl+Shift+H for pin and Ctrl+Shift+G for show/hide, the same letters as the unused use-keybinds.ts, which this replaces. The other two start unbound. A new Hotkeys tab lets you record a combination, clear it, and shows an error inline when another app or another command already uses it.

Bindings are stored in config.json in the shape you suggested in #201 ({ "key": ..., "command": "pin" }). Since the config still only lives in the frontend, the main window sends the bindings to a Rust command, and Rust registers them through tauri-plugin-global-shortcut. Pin and open settings run in Rust, show/hide and next monitor go back to the frontend as events.

A few choices you may want to weigh in on:

  • it adds tauri-plugin-global-shortcut 2.2.0 as a Rust dependency, matching the JS package that was already in package.json
  • hiding sets opacity to 0 and makes the window click-through instead of calling hide(), because show() activates the window on Windows and would pull focus out of a fullscreen game
  • toggle_pin and set_pin are wrapped in hotkeys.rs under the same IPC names, so a hidden overlay stays click-through when it gets unpinned, and the tray uses the same path
  • Wayland can't register global shortcuts, so the tab shows a note there and records nothing

Tested on Windows 11 by pressing the default hotkeys against the installed build with another window in the foreground. Pin and show/hide toggled, the anchored corner stayed put, and the foreground window never changed. macOS and Linux are only built by CI. The key conversion and the register/unregister logic have unit tests in hotkeys.rs.

Adds an opt-in Fixed position mode. The overlay is placed by monitor, one of nine anchors and a margin, sizes itself to the user list and stays click-through. Starting Overlayed again while it runs opens the settings.

Refs overlayeddev#293, overlayeddev#291
Adds global hotkeys for pin, show/hide, next monitor and open settings, with a Hotkeys tab to record them. Bindings live in config.json in the shape suggested in overlayeddev#201 and are registered from Rust through tauri-plugin-global-shortcut. Replaces the unused use-keybinds hook.

Refs overlayeddev#201
@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
overlayed Skipped Skipped Oct 3, 2026 6:40pm UTC

Request Review

This branch was previously deployed

1 inactive deployment
Preview — 01e2374e Deployed Oct 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant