Character code instead of key code

I heed to detect character code typed on the keyboard. The event onKeyPressed returns key code but I need character code instead because I have different actions for ‘{’ and ‘[’, for example. Could you please advice how to obtain this codes. Thanks!