Skip to content

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

Merged
miguel-heygen merged 1 commit into
heygen-com:mainfrom
HOSS1E:add-mute-loop-shortcuts
May 20, 2026
Merged

feat(studio): add M (mute) and Shift+L (loop) keyboard shortcuts#992
miguel-heygen merged 1 commit into
heygen-com:mainfrom
HOSS1E:add-mute-loop-shortcuts

Conversation

@HOSS1E
Copy link
Copy Markdown
Contributor

@HOSS1E HOSS1E commented May 20, 2026

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
@miguel-heygen miguel-heygen self-requested a review May 20, 2026 21:51
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean addition. Small scope, well-tested.

Verified:

  • Shift+L handler placed before the existing plain L handler — correctly prevents fall-through to forward shuttle
  • Both handlers placed after if (e.repeat) return — holding the key doesn't rapid-fire toggle
  • M mute gating (playbackRate <= 1) matches the mute button's disabled prop — consistent behavior
  • Ctrl+L intentionally omitted — shouldIgnorePlaybackShortcutEvent already filters ctrlKey/metaKey/altKey, and Ctrl+L conflicts with browser address bar
  • 4 tests cover: toggle on/off, no-op above 1x, Shift+L isolation from shuttle, plain L regression guard
  • Help panel updated with both shortcuts in the Playback section

@miguel-heygen miguel-heygen merged commit 93728d7 into heygen-com:main May 20, 2026
33 checks passed
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)

2 participants