Utilizing KeyPressTarget Demo Code?


I am able to get visual inside the plugin.
However, I am unable to get the class/button to respond to key events.
Any Ideas where to put, and what functions to use when calling the KeyPressTarget class?


Are you using the KeyMappingsDemo example? If not, this is a good place to look to see how to handle key press commands in JUCE


The class I am referring to resides in the KeyMapping demos.

I just can’t seem to get the “copied” class to respond to key press or receive keyboard focus within the plugineditor.

Any way you know where to call Keypress functions or to set the keyboard focus so the block will respond by moving to arrow keys?


Have you tried enabling the “Plugin Editor Requires Keyboard Focus” option in the plugin project settings in the Projucer?


Thanks, it seems my pursuit was doomed before the class calls.

I enabled VST keyboard focus, However I am still at a loss to get the basic functionality of class demo to work. As I fun exercise I am trying to make a Pong game.

In my plugineditor.h

KeyPressTarget Player;

PongAudioProcessorEditor::PongAudioProcessorEditor (PongAudioProcessor& p)
: AudioProcessorEditor (&p), processor §
// Make sure that before the constructor has finished, you’ve set the
// editor’s size to whatever you need it to be.
setSize (900, 500);
Player.setSize(900, 500);


// =======================================================

Any major gaps I am missing? Thanks again, for the help thus far…