fix(studio): use e.key for playback shortcuts so non-QWERTY layouts work#839
Merged
jrusso1020 merged 1 commit intoMay 14, 2026
Conversation
The 7 letter shortcuts (J/K/L/I/O/A/E) in usePlaybackKeyboard were gated on `e.code === "Key*"`, which is the physical key position on a US-QWERTY layout. On AZERTY (and other layouts) the physical "KeyA" slot produces e.key="q", so "Jump to in-point" and the rest of the letter shortcuts either fired on the wrong character or not at all. Switch the 7 letter shortcuts to compare `e.key.toLowerCase()` and rename `pressedCodesRef` → `pressedKeysRef` so the K-hold combo (K+J / K+L for frame stepping) is also keyed off the typed character. `Space` and `Arrow*` keep using `e.code` since those codes are layout-independent. Adds a happy-dom test covering QWERTY happy path, AZERTY (physical KeyQ produces e.key="a" → in-point seek fires), AZERTY contrapositive (physical KeyA producing e.key="q" no longer triggers in-point), Shift+I clears in-point, K-hold combo for frame stepping, K release returning the set to clean state, and Space passthrough. Addresses bug heygen-com#3 in heygen-com#834. Bugs heygen-com#1 (loop at out-point) and heygen-com#2 (Jump to in-point forcing pause) live outside this hook (player loop and adapter `seek` respectively) and are left for follow-up PRs.
miguel-heygen
approved these changes
May 14, 2026
jrusso1020
added a commit
that referenced
this pull request
May 14, 2026
…o legible Two surgical changes, both isolated to the catalog-previews flow: 1. `packages/studio/src/player/hooks/usePlaybackKeyboard.test.ts` PR #842 changed `seek()` to take `(time, { keepPlaying: true })` for the A/E shortcuts. The keyboard-layout tests added by #839 still asserted the single-arg form. Both landed on main without cross-checking, so `main` itself has been failing Test/Windows since. Update the two assertions to match the new signature. Same fix Miguel already authored on `feat/studio-preview-pasteboard-bg`. 2. `registry/components/vignette/demo.html` The original demo captured a frame where the vignette was at its weakest point — the effect was nearly invisible in the static preview used by docs. Reworked the demo so: - The backdrop is a layered "cinematic still" (warm key + teal rim + dark falloff) and includes a centered subject ("moon"), so the vignette has a focal point to frame. - Vignette starts soft (size 70%, alpha 0.35) and ramps to a dramatic cinematic vignette (size 26%, alpha 0.92) over 1.6s. - Peak intensity holds across t≈3.0s, which is exactly where the catalog script samples the thumbnail (`Math.min(3.0, duration*0.6)` with duration=5). - Breathing motion in t=3.4–5.2s gives the video loop visible life without disturbing the still frame.
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The 7 letter shortcuts (J/K/L/I/O/A/E) in
packages/studio/src/player/hooks/usePlaybackKeyboard.tsare gated one.code === "Key*", which is the physical key position on a US-QWERTY layout. On AZERTY (and other layouts) the physicalKeyAslot producese.key="q", so "Jump to in-point" and the rest of the letter shortcuts either fire on the wrong character or not at all.Switch the 7 letter shortcuts to compare
e.key.toLowerCase()and renamepressedCodesRef→pressedKeysRefso the K-hold combo (K+J / K+L for frame stepping) is also keyed off the typed character.SpaceandArrow*keepe.codesince those codes are layout-independent.Scope
Addresses bug #3 in #834 (the AZERTY one originally reported for
A, generalized here to all 7 letter shortcuts since the samee.codepattern was used in 7 places).Bug #1 (loop at out-point) and bug #2 (Jump to in-point forcing pause) from the same issue are left for follow-up PRs — they live outside this hook (player loop and adapter
seekrespectively) and a focused PR is easier to review.Tests
New
usePlaybackKeyboard.test.ts(happy-dom) covering:KeyA+e.key="a"→ seek to in-point firesKeyQ+e.key="a"→ seek to in-point firesKeyA+e.key="q"→ seek does not fireShift+Iclears in-point (e.key="I" is matched after lowercasing)Spacepassthrough (e.code path still works)Out of scope (intentionally)
e.keyis the localized character there, which won't match ASCII shortcut letters. This matches the convention in Google Docs / VS Code and the issue did not request it.Validation
bunx oxlint <changed>→ 0 warnings, 0 errorsbunx oxfmt --check <changed>→ cleanbun run --cwd packages/studio typecheck→ cleanbun run --cwd packages/studio test→ 497 passed (47 files), including the 7 new tests