Function keys in TextEditor and CodeEditorComponent


#1

Hey Jules, the function keys are currently captured as characters in TextEditors and CodeEditorComponents.  I think this is probably a bug.

In text editors they appear as a "u" with two dots on top, and in the CodeEditorComponent they show up as squares with an "x" in the middle.  I've attached an image of the Introjucer.  As a side note the CodeEditorComponent's caret is also misaligned with these characters.

 

 


#2

I've added this to the if statements in keyPressed for TextEditor and CodeEditorComponent and it appears to do the trick but I'm only testing on OSX and not sure if the values are sequential on other platforms.  On top of that having a look at NSEvent.h there are a lot of special keys with greater values than F16 so perhaps something more fine grained is necessary for a proper fix.

 

(key.getTextCharacter() < KeyPress::F1Key || key.getTextCharacter() > KeyPress::F16Key)

#3

Thanks for the heads-up - I'll sort that out!


#4

Fix confirmed in latest git.  Thanks!