Skip to content

feat: add configurable option to customize or disable studio keyboard shortcut#453

Open
mateusznarowski wants to merge 1 commit into
nuxt-content:mainfrom
mateusznarowski:feat/configurable-studio-shortcut
Open

feat: add configurable option to customize or disable studio keyboard shortcut#453
mateusznarowski wants to merge 1 commit into
nuxt-content:mainfrom
mateusznarowski:feat/configurable-studio-shortcut

Conversation

@mateusznarowski
Copy link
Copy Markdown
Contributor

🔗 Linked Issue

Closes #131

📋 Description

Adds a new shortcut module option that allows users to customize or disable the keyboard shortcut used to open Studio.

The original implementation only checked event.metaKey, which maps to the Windows/Super key on Windows/Linux (not Ctrl), making the shortcut non-functional on those platforms. On Windows, Win + . is additionally intercepted by the OS to open the emoji picker, so the event never reached the browser.

Changes

  • New shortcut option in ModuleOptions (string | false, default: 'meta_.')
    • 'meta_.' (default) — Cmd + . on macOS, Ctrl + . on Windows/Linux
    • Custom value (e.g. 'shift_meta_k') — parsed using the same format as defineShortcuts
    • false — disables the shortcut entirely
  • Shortcut parsing in activation plugin — supports modifiers (meta/command, ctrl, shift, alt/option) with automatic metaCtrl conversion on Windows/Linux, matching defineShortcuts behavior
  • Dynamic shortcut in Studio appapp.vue passes shortcut value to defineShortcuts instead of hardcoding 'meta_.'
  • Cross-platform fix — original implementation only used event.metaKey, which maps to the Windows/Super key on non-macOS platforms, making the shortcut non-functional

Files changed

  • src/module/src/module.tsshortcut option in ModuleOptions, defaults, and runtime config
  • src/module/src/runtime/utils/activation.ts — shortcut parsing for unauthenticated users
  • src/module/src/runtime/host.ts — pass shortcut to Studio app via StudioHost.meta
  • src/app/src/types/index.tsshortcut property on StudioHost.meta
  • src/app/src/app.vue — dynamic defineShortcuts registration

Usage

// nuxt.config.ts
export default defineNuxtConfig({
  studio: {
    shortcut: 'shift_meta_k' // or false to disable
  }
})

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

@mateusznarowski is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

npm i https://pkg.pr.new/nuxt-studio@453

commit: 5145cbc

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.

Customize/disable studio shortcut

1 participant