Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key events not working in Reaper on macOS #169

Open
httnn opened this issue Mar 18, 2024 · 2 comments
Open

key events not working in Reaper on macOS #169

httnn opened this issue Mar 18, 2024 · 2 comments

Comments

@httnn
Copy link
Contributor

httnn commented Mar 18, 2024

the NSView's keyDown/keyUp methods are never getting called in Reaper when there's keyboard input with the plugin window in focus. neither turning on "Send all keyboard input to plugin" or opening the UI in its own window changed the situation.

curiously, the events are still consumed on some level as Reaper is also not receiving keyboard events when the plugin window is in focus (space doesn't toggle playback, for example).

i'm running macOS 13.5.2 and Reaper 6.43 and using baseview with nih_plug

@httnn
Copy link
Contributor Author

httnn commented Mar 18, 2024

wondering if the problem actually lies within nih_plug: the VST3 onKeyDown implementation returns kResultOk, but according to the API docs it should return either kResultTrue or kResultFalse depending on whether the key is consumed. perhaps kResultOk is interpreted similarly to kResultTrue?

i have a feeling that Reaper might be using these VST3 key handlers more pedantically than most hosts

@httnn
Copy link
Contributor Author

httnn commented Mar 18, 2024

returning kResultFalse from the VST3 key handlers indeed allows the key events to flow to the plugin (this has been fixed in nih-plug now robbert-vdh/nih-plug@245add6)! but now the problem is that no key events are being consumed from Reaper's perspective, so e.g. the spacebar and enter keys will always get passed to Reaper. to fix this, baseview would need to have some way to signal to the VST3 key handlers about when to consume/ignore key events, but not sure what that would require.

this is also an issue with JUCE btw: https://forum.juce.com/t/reaper-stealing-spacebar-keystrokes-in-texteditor/30689/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant