This project has moved and is read-only. For the latest updates, please go here.

Capturing keyboard input and/or passing it to the host

Topics: Editor UI, Host Compatibility
Apr 27, 2013 at 6:49 PM

In the VSTi I'm working on there is a textbox on the main form. In some hosts (e.g. Live), users are able to type into that textbox with no problems but can't control the host with the keyboard until my VSTi looses focus. In other hosts (e.g. Reaper and Sonar) users either can't type anything into the textbox or can only enter certain characters.

Ideally I'd like to capture the keyboard input while users are typing into this textbox and let the host handle keyboard input any other time.

Any idea if something like this is possible? I could always put the textbox into a modal dialog but I'm hoping to find a better solution.

Apr 28, 2013 at 5:16 PM
On the interface that is used to implement a plugin editor (IVstPluginEditor) there are two methods names KeyDown and KeyUp.

I have no experience with intercepting key strokes but my guess is that these methods are called by the host when key strokes happen when the plugin has focus.
I suggest you try to see if these methods are called by all hosts and the try to funnel the keystroke to the control that has the focus...?
Apr 29, 2013 at 12:02 AM
Thanks! I'll take a look at that and see what I can find.
May 1, 2013 at 2:56 AM
So I tested this out in two hosts. In Ableton Live those functions get called when the plugin has focus but they don't get called if any of the controls have focus. Unfortunately in Sonar the functions never get called. I came across this long post and it looks like other people have run into the same problem. I guess I'll just go for the modal dialog solution.
May 1, 2013 at 9:23 AM
Yeah, its one of those icky VST parts...

Thanx for letting us know.