DISTRHO / DPF

DISTRHO Plugin Framework
ISC License
672 stars 97 forks source link

[Windows VST] Keyboard input not being received by plugin in some hosts #138

Open pdesaulniers opened 5 years ago

pdesaulniers commented 5 years ago

Right now, the onKeyboard event is not necessarily called in Windows VST builds, depending on the host. For instance, it is properly called in FL Studio, but not in Carla and Renoise (even with the 'Enable Keyboard' option enabled).

The issue is present on both the master and develop branch.

It seems like calling getParentWindow().focus() temporarily fixes this in Carla.

Is it up to the host to relay keyboard events to the plugin, or is there something we can do in DPF to make sure that the plugin receives the events?

falkTX commented 5 years ago

This is something the hosts need to handle.

If plugins try to mess around with things, we will get Linux in the same situation of Windows, where things are now too messy and out of hand. When everyone fights for focus, nobody wins.

Please open a ticket against carla, reporting a plugin where it can be reproduced in.

falkTX commented 5 years ago

by the way, which plugin are you testing this with? not a lot of them have keyboard input...

pdesaulniers commented 5 years ago

I'm testing it with the MidiKeyboard plugin. I was planning on adding keycodes support to the plugin in a later PR. It doesn't handle onKeyboard as of now.

falkTX commented 5 years ago

ah okay, so it has keyboard input already. one more reason for me to review it quickly then.

pdesaulniers commented 5 years ago

Well, it has keyboard input, but I haven't pushed it yet :) I figured it was better splitting this into two PRs.

falkTX commented 5 years ago

Please push some barebones keyboard input, even if forced to qwerty layout for now. That will make it handy, and I am fine with merging an initial version with just that.

pdesaulniers commented 5 years ago

Done.

Note that I've only tried this in the latest Carla release, not the latest Carla on the develop branch. I can reproduce the issue by running the keyboard example using the win64 bridge on Linux.