In MyTextEdior (inherits from juce::TextEdior), I want do some punctuation-matching, see:
bool MyTextEditor::keyPressed (const KeyPress& key)
{
// ...
else if (key == KeyPress ('['))
{
const String& selectedStr (getHighlightedText ());
insertTextAtCaret ("[" + selectedStr + "]");
if (selectedStr.isEmpty ())
moveCaretLeft (false, false);
return true;
}
// ...
}
It works fine for all the English punctuations. but When I enabled IME (Chinese), I can’t get the correct key code, most of the key’s code and all the Chinese punctuations’ key code is 0…
What should I do?
Thanks!