surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.14k stars 400 forks source link

We steal Esc from host in CLAP #6838

Closed mkruselj closed 1 year ago

mkruselj commented 1 year ago

Try opening Surge CLAP in Reaper as a floating window, then press Esc. The expected behavior is that the floating window would close (like with any other plugin loaded in Reaper), but it doesn't.

VST3 works fine as expected.

baconpaul commented 1 year ago

Ahh yes the clap keypress issues. Sigh.

mkruselj commented 1 year ago

This doesn't happen with u-he or TAL CLAPs, just for reference.

baconpaul commented 1 year ago

thanks i wonder if it is something in CJE.

baconpaul commented 1 year ago

Ahh joy of joys in reaper 6.73 on macOS, esc closes a clap just like it does a vst. lemme upgrade to 6.77 and check also.

your reaper version @mkruselj ?

mkruselj commented 1 year ago

Happens in any Reaper version for me. Currently I'm running the latest prerelease (dev0302).

baconpaul commented 1 year ago

yup ok 6.77 macOS arm escape closes the window no problem.

baconpaul commented 1 year ago

Maybe try with an explicit return false; at this line https://github.com/surge-synthesizer/surge/blob/6ad105a2ce5d7c2947677480ef84922aef88994b/src/surge-xt/gui/SurgeGUIEditor.cpp#L7219 and see if that helps?

mkruselj commented 1 year ago

OK so... this is weird. That line seems to work but only if Reaper's option "Send all keyboard input to plugin" is DISABLED. WTF?!

Can you try the same on Mac?

EDIT: Actually it all works just fine even without that added line, if that option in Reaper is disabled. Baffling.

baconpaul commented 1 year ago

remind me where i find that option?

mkruselj commented 1 year ago

OK so this is in the end not our bug. WIth that option enabled Esc doesn't work with TAL or u-he or even VST3, so it's not CLAP specific.

I guess the logic is - by default, Reaper intercepts Esc and uses that to close the plugin window. If we enable the option that is specifically named "Send ALL keyboard input to PLUGIN", that means plugin gets to handle that Esc and not the host. Hence the window doesn't close.

Oh well!