fix(view): plugin editor wins the spacebar for a focused text field#6406
Merged
Conversation
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).
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.
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
claudem5~/Code/pulp-spacebar14ef2f39-9113-4e61-bd8b-8faab97cab00Resume
Jump to this tab
Relaunch (any agent)
Restore URL — https://claude.ai/code/session_015tUppDEybTgFDxS5BGKBWV
stamped 2026-07-20 18:43 UTC