Capturing keyboard input and/or passing it to the host

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

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.

Thanks,
Rob
Coordinator
Apr 28, 2013 at 4:16 PM
On the interface that is used to implement a plugin editor (IVstPluginEditor) there are two methods names KeyDown and KeyUp. https://vstnet.codeplex.com/SourceControl/changeset/view/71210#191281

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 28, 2013 at 11:02 PM
Thanks! I'll take a look at that and see what I can find.
May 1, 2013 at 1: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 http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=1662&sid=c7471c78dc76b977221fe2c29add281a and it looks like other people have run into the same problem. I guess I'll just go for the modal dialog solution.
Coordinator
May 1, 2013 at 8:23 AM
Yeah, its one of those icky VST parts...

Thanx for letting us know.
Marc