KeyBinding.char constructor

KeyBinding.char(
  1. bool matcher(
    1. String char
    ),
  2. KeyActionResult action(
    1. KeyEvent event
    ), {
  3. String? hintLabel,
  4. String? hintDescription,
})

Creates a binding for character input matching a predicate.

Implementation

factory KeyBinding.char(
  bool Function(String char) matcher,
  KeyActionResult Function(KeyEvent event) action, {
  String? hintLabel,
  String? hintDescription,
}) {
  return KeyBinding(
    keys: {KeyEventType.char},
    charMatcher: matcher,
    action: action,
    hintLabel: hintLabel,
    hintDescription: hintDescription,
  );
}