Reaper stealing spacebar keystrokes in TextEditor

I’ve looked at the other threads, this seems to be the most fitting and recent one.

Just ran into this on macOS Reaper. Turns out: Reaper DOES give the Spacebar to the VST3 plugin, but the JUCE VST3 wrapper does not implement IPlugView::onKeyDown, so it’s not getting handled. I tried this in a hacky way. If I send the space to the focussed component and in that case return kResultTrue, the space is processed properly by my text editors, and Reaper doesn’t toggle play.

If you want to try it:
override onKeyDown in juce_VST3_Wrapper, nulltest component and getCurrentlyFocusedComponent, if we got one, call keyPressed on that component. keyMsg 7 is the space bar.

Doing this properly and handling everything is some effort because it needs translation of virtual key codes for many cases. There is a lengthy enum with Steinbergs virtual key codes in the VST SDK.

I do wonder why it’s not implemented in JUCE? This is just plain regular VST3 API and at first glance appears to be a nicer way to cooperate with the plugin host when it comes to keyboard handling, instead of fighting for keyboard input on OS windowing level. I might be wrong of course.

No idea what to do about .AU yet, but there is probably a similar solution.