No keyboard input?


#1

Hello all,

I’m certain I remember some discussion of this in the past – I can’t seem to get keyboard input to a TextEditor field in my GUI.
I’m running on a Mac with a simple GUI consisting of a couple of text input fields and a TableListBox.

Does the top-level component have to be a KeyListener?
Does it have to grab KBD focus?

I have code (in resized()) telling all other widgets setWantsKeyboardFocus(false) and telling the text editor component,

searchKeyInput->setWantsKeyboardFocus(true);
searchKeyInput->grabKeyboardFocus();

Could someone elucidate me as to what I’m forgetting?

…any reply appreciated…

stp


#2

One more think: my app happily echoes keyboard input to its stdout.

stp


#3

I’ve no idea how you’d manage to stop a TextEditor getting focus - that’s exactly what they’re designed to do, you don’t need to call anything special to make it happen. Perhaps try not calling setWantsKeyboardFocus() on it? The juce demo is full of texteditor examples - perhaps have a look at those and see what you’re doing differently?


#4

Thanks for the note, Jules.

I replaced my project file with the HelloWorld demo and it works – still not certain what I was doing wrong…

stp