Skip to content

fix(view): plugin editor wins the spacebar for a focused text field#6406

Merged
shipyard-local[bot] merged 3 commits into
mainfrom
fix/plugin-editor-spacebar
Jul 20, 2026
Merged

fix(view): plugin editor wins the spacebar for a focused text field#6406
shipyard-local[bot] merged 3 commits into
mainfrom
fix/plugin-editor-spacebar

Conversation

@shipyard-local

@shipyard-local shipyard-local Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Embedded plugin views (PulpPluginView/PulpGpuPluginView, used by AU/VST3/CLAP
hosts) only intercepted Cmd-chords in performKeyEquivalent:, so a plain space —
which macOS delivers there BEFORE keyDown: — fell through to the host, and DAWs
(REAPER/Logic/Live) that bind Space to transport stole it before a focused text
field could see it. Typing in a plugin's text box dropped every space.

Route plain printable keys through pulp_plugin_key_down and report handled when a
text field is actually focused (pulp_text_input_focused_under_root), so the host
never gets them. Gated so transport + Musical Typing still work when not typing;
the cmd/ctrl guard leaves real host shortcuts alone. Standalone PulpView already
did this — this brings the embedded plugin views to parity.

Tests: two new cases in test_mac_perform_key_equivalent.mm pin both halves
(focused text field consumes Space; no focused field passes it through).


🔎 Provenance

Agent claude
Machine m5
Tab Analyze Pulp for AI plugin builder capabilities
Directory ~/Code/pulp-spacebar
Session 14ef2f39-9113-4e61-bd8b-8faab97cab00

Resume

claude --resume 14ef2f39-9113-4e61-bd8b-8faab97cab00

Jump to this tab

cmux surface focus BD0A704A-23E0-4F9B-88CC-25BD1ACDAFEA

Relaunch (any agent)

cmux surface resume get --surface BD0A704A-23E0-4F9B-88CC-25BD1ACDAFEA

Restore URLhttps://claude.ai/code/session_015tUppDEybTgFDxS5BGKBWV

stamped 2026-07-20 18:43 UTC

Embedded plugin views (PulpPluginView/PulpGpuPluginView, used by AU/VST3/CLAP
hosts) only intercepted Cmd-chords in performKeyEquivalent:, so a plain space —
which macOS delivers there BEFORE keyDown: — fell through to the host, and DAWs
(REAPER/Logic/Live) that bind Space to transport stole it before a focused text
field could see it. Typing in a plugin's text box dropped every space.

Route plain printable keys through pulp_plugin_key_down and report handled when a
text field is actually focused (pulp_text_input_focused_under_root), so the host
never gets them. Gated so transport + Musical Typing still work when not typing;
the cmd/ctrl guard leaves real host shortcuts alone. Standalone PulpView already
did this — this brings the embedded plugin views to parity.

Tests: two new cases in test_mac_perform_key_equivalent.mm pin both halves
(focused text field consumes Space; no focused field passes it through).
…field

REAPER (with 'send all keyboard input to plug-in' OFF — its default) offers keys
to the view through IPlugView::onKeyDown BEFORE its transport accelerator. Pulp's
PulpPlugView never implemented onKeyDown, so the base returned kResultFalse,
REAPER claimed Space for play/stop, and the event never reached the NSView key
path — a focused chat/text field dropped every space while letters (which REAPER
does not bind) typed fine. The prior performKeyEquivalent: change cannot help an
event that never arrives at the NSView layer.

Implement onKeyDown scoped to Space only (host_quirks: reaper_keyboard_only_space
— Space is the only key REAPER delivers well-formed here), excluding Cmd/Ctrl
chords, and consuming only when a TextEditor inside this editor's tree holds
focus. Every other key returns kResultFalse so transport, Musical Typing, and host
shortcuts are untouched.

Verified live by an A/B CGEvent test in default REAPER (spaces dropped pre-fix,
typed post-fix). Unit tests pin the scoping guards (non-Space, Cmd/Ctrl-Space, and
Space-with-nothing-focused all fall through to the host); the positive path needs
a hosted view attach and is covered by the live proof.
…NSView key path)

Records why a plugin text field drops only the spacebar in REAPER: the host
delivers Space via IPlugView::onKeyDown before its transport accelerator, so the
event never reaches the NSView layer. Maps the two key-routing layers (format
onKeyDown vs NSView performKeyEquivalent) and the debugging rule. Accompanies the
vst3_plug_view onKeyDown fix (skill_path_map: vst3_plug_view -> view-bridge).
@shipyard-local
shipyard-local Bot merged commit 1a64939 into main Jul 20, 2026
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant