I know there are already a lot of posts about keys in plugins, but i could not find an answer for that specific problem. It's not possible to enter a space key within the TextEditor component in our plugin on OSX with Reaper. Space directly starts and stops playing the arrangement in reaper. I like that behavoir, but i want to be able to enter a space key when the TextEditor field has the focus. I already have set setWantsKeyboardFocus(true) without any success.
What can i do to receive the space key for text input?
Not ideal, but Reaper has an option to “Send all keyboard input to plug-in”.
Thanks for the answer. That works for us.
Any news on this? Our plugins made with JUCE does not receive space, or @-key, in Reaper (OSX AU/VST are the ones I’ve tested so far). The plugins made with VSTGui do receive these keys even if “Send all keyboard input to plug-in” is not selected, so it seems like it could be fixed.
I’ve seen proposed fixes in other threads, but wouldn’t it be better if it was fixed in JUCE?
I’ve the same problem.
has anyone been able to fix it without creating a new window?
I’d also love a fix for this and I’d be interested to know how VSTGUI achieves it.
I’ve experimented with various hacks including adding
NSEvent addLocalMonitorForEventsMatchingMask:handler: and
NSEvent addGlobalMonitorForEventsMatchingMask:handler: to a view within a plugin and neither handler gets called for events that are “stolen” by Reaper.
I’ve also experimented with
makeFirstResponder: for a view but that doesn’t work either.
When you say “The plugins made with VSTGui do receive these keys even if “Send all keyboard input to plug-in” is not selected”, which plugins are you referring to?
I just took a quick look at the VSTGUI code and unless I missed something, it doesn’t seem to be doing anything special to receive keyboard input, at least nothing that JUCE isn’t already doing in
I’ve done a bit more digging on this, and it’s possible to receive “global” keyboard input by installing an “event tap” as shown here: http://osxbook.com/book/bonus/chapter2/alterkeys/ However this has the secondary problem that in order to work, the host elevated permissions to receive the events, e.g. to have been added to the “apps allowed to control the computer” Accessibility setting in OS X Preferences.