Function KeyboardEvent.isCharacter

Returns true if the event was a normal typed character.

bool isCharacter();

You may also want to check modifiers if you want to process things differently when alt, ctrl, or shift is pressed. [modifierStateFiltered] returns only modifiers that are special in some way for the typed character. You can bitwise and that against [ModifierState]'s members to test.

[isUnmodifiedCharacter] does such a check for you.

Please note that enter, tab, and backspace count as characters.