Hi, I have a subclass of CodeEditorComponent (called CodeBuffer) that defines its own keyPressed() method. im noticing some behavior in juce TIP that was NOT present in JUCE v1.50 so I think im not understanding how keypresses are handled now.
my CodeBuffer::KeyPressed() method implements some Emacs style commands (combinations of control and option keystrokes) and also wants to get all the keypresses that arrive at the window. So for example, in addition to catching Control/Option keypresses it also wants to catch non-mod presses like ‘\t’ an ‘)’ so it can do syntactic code indentation and “matching parens” highlighting, for example.
now, my keyPressed() method does get called for most keypresses, but not all of them. for example it gets called when Tab and Backspace are pressed but but not when ‘)’ or any other non-modified char is pressed (the non-modified chars are getting trapped by someone and appear in the buffer however)
also keypresses that involve just the option key dont arrive ie when Option+f is pressed my method never get called. instead the Option mod causes non-ascii font chars to get inserted in my buffer. But my keyPressed method DOES get called correctly with control+option+f and control+f.
what I want to do is have my keyPressed() method receive ALL keypresses and – if it doesnt want to handle the current keypress – just call juce’s CodeEditorComponent::keyPressed for standard processing of that press.
as i say, this all works n v150 but not in the tip – im not sure how to insure that my keyPressed() method gets keypresses like ‘)’ and Option modified presses.
in all other respects the code editor support in tip is working beautifully for me!!