isDeferrablePrintableKeyEvent static method
True when this KeyEvent is a text character IME should own (not
Backspace/DEL/C0 controls — macOS may set character on those).
Implementation
static bool isDeferrablePrintableKeyEvent(
KeyEvent event,
HardwareKeyboard hw,
) {
if (hw.isControlPressed || hw.isAltPressed || hw.isMetaPressed) {
return false;
}
if (terminalKeys.contains(event.logicalKey)) {
return false;
}
final ch = event.character;
if (ch == null || ch.isEmpty) return false;
for (final unit in ch.codeUnits) {
if (unit < 0x20 || unit == 0x7f) return false;
}
return true;
}