Skip to content

feat(studio): add M (mute) and Shift+L (loop) keyboard shortcuts#993

Closed
hg-oneeyekeh wants to merge 1 commit into
heygen-com:mainfrom
hg-oneeyekeh:add-mute-loop-shortcuts
Closed

feat(studio): add M (mute) and Shift+L (loop) keyboard shortcuts#993
hg-oneeyekeh wants to merge 1 commit into
heygen-com:mainfrom
hg-oneeyekeh:add-mute-loop-shortcuts

Conversation

@hg-oneeyekeh
Copy link
Copy Markdown

Summary

Adds NLE-style keyboard shortcuts for muting audio and toggling loop playback in the Studio player, matching the conventions in DaVinci Resolve, Premiere, and Final Cut.

  • M — toggle audio mute
  • ⇧L — toggle loop playback

Fixes #905.

Implementation notes

  • Both handlers live in usePlaybackKeyboard.ts alongside the existing J / K / L / I / O / A / E shortcuts. The Shift+L case runs before the existing plain-L shuttle case so Shift+L doesn't also kick off forward playback.
  • M mirrors the mute button's gating: above 1x playback, audio is force-muted by shouldMutePreviewAudio, so the shortcut becomes a no-op there (just like the button is disabled).
  • The issue mentioned Ctrl+L as an alternative. It's intentionally not wired up because shouldIgnorePlaybackShortcutEvent already filters out events with ctrlKey/metaKey/altKey, and Ctrl/Cmd+L conflicts with the browser address-bar shortcut. Shift+L is also consistent with the existing Shift+I / Shift+O modifier pattern in this hook.
  • The in-app shortcuts help panel (PlayerControls.tsx) lists the two new shortcuts in the "Playback" section.

Test plan

  • bun run --filter @hyperframes/studio test — all 601 studio tests pass, including 4 new tests covering: M toggles mute, M is a no-op above 1x, Shift+L toggles loop without starting shuttle, plain L still starts shuttle (regression guard).
  • bunx oxlint + bunx oxfmt --check on changed files — clean.
  • bun run --filter @hyperframes/studio typecheck — clean.
  • Manual verification: open Studio, focus the player, press M (mute icon toggles), press Shift+L (loop icon toggles), confirm plain L still starts forward shuttle.

Adds NLE-style hotkeys for muting audio and toggling loop playback in the
Studio player, matching the workflow conventions in DaVinci Resolve,
Premiere, and Final Cut.

- M toggles audio mute (no-op above 1x playback, matching the mute button's
  existing gating behavior).
- Shift+L toggles loop. Ctrl/Cmd+L was considered but is filtered out by
  shouldIgnorePlaybackShortcutEvent and conflicts with the browser address
  bar; Shift+L is also consistent with the existing Shift+I / Shift+O
  modifier pattern.

The Shift+L handler runs before the existing plain-L shuttle case so it
doesn't also start forward playback.

Fixes heygen-com#905
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.

(studio) Add keyboard shortcuts to toggle muting and looping (NLE standards)

1 participant