catch displayable chars from keyboard

hello, i am trying to implement my own textfield, so i attach a KeyListener and in the keytyped(KeyEvent e) function i add the e.getKeyChar() chars to a string.

unfortunately this also adds chars to the string that are not really readable chars, like when someone presses BACKSPACE or CTRL+V or ESC.

is there any easy way to filter only readable characters out? thanks!

maybe

java.lang.Character.isLetterOrDigit(char ch)

thanks, but that will not allow special chars like !§"$%&/() … :wink: