defaultTextFieldImeKeyboardHandlers top-level constant

List<TextFieldKeyboardHandler> const defaultTextFieldImeKeyboardHandlers

The keyboard actions that a SuperTextField uses by default when using TextInputSource.ime.

Using the IME on desktop involves partial input from the IME and partial input from non-content keys, like arrow keys.

This list has the same handlers as defaultTextFieldKeyboardHandlers, except the handlers that input text. Text input is handled using TextEditingDeltas from the IME.

It's common for developers to want all of these actions, but also want to add more actions that take priority. To achieve that, add the new actions to the front of the list:

SuperTextField(
  keyboardActions: [
    myNewAction1,
    myNewAction2,
    ...defaultTextFieldImeKeyboardHandlers,
  ],
);

Implementation

const defaultTextFieldImeKeyboardHandlers = <TextFieldKeyboardHandler>[
  DefaultSuperTextFieldKeyboardHandlers.copyTextWhenCmdCIsPressed,
  DefaultSuperTextFieldKeyboardHandlers.pasteTextWhenCmdVIsPressed,
  DefaultSuperTextFieldKeyboardHandlers.selectAllTextFieldWhenCmdAIsPressed,
  DefaultSuperTextFieldKeyboardHandlers.scrollToBeginningOfDocumentOnCtrlOrCmdAndHome,
  DefaultSuperTextFieldKeyboardHandlers.scrollToEndOfDocumentOnCtrlOrCmdAndEnd,
  // WARNING: No keyboard handlers below this point will run on Mac. On Mac, most
  // common shortcuts are recognized by the OS. This line short circuits SuperTextField
  // handlers, passing the key combo to the OS on Mac. Place all custom Mac key
  // combos above this handler.
  DefaultSuperTextFieldKeyboardHandlers.sendKeyEventToMacOs,
  DefaultSuperTextFieldKeyboardHandlers.scrollOnPageUp,
  DefaultSuperTextFieldKeyboardHandlers.scrollOnPageDown,
  DefaultSuperTextFieldKeyboardHandlers.scrollToBeginningOfDocumentOnHomeOnMacOrWeb,
  DefaultSuperTextFieldKeyboardHandlers.scrollToEndOfDocumentOnEndOnMacOrWeb,
  DefaultSuperTextFieldKeyboardHandlers.moveCaretToStartOrEnd,
  DefaultSuperTextFieldKeyboardHandlers.moveUpDownLeftAndRightWithArrowKeys,
  DefaultSuperTextFieldKeyboardHandlers.moveToLineStartWithHome,
  DefaultSuperTextFieldKeyboardHandlers.moveToLineEndWithEnd,
  DefaultSuperTextFieldKeyboardHandlers.deleteWordWhenAltBackSpaceIsPressedOnMac,
  DefaultSuperTextFieldKeyboardHandlers.deleteWordWhenCtlBackSpaceIsPressedOnWindowsAndLinux,
  DefaultSuperTextFieldKeyboardHandlers.deleteTextOnLineBeforeCaretWhenShortcutKeyAndBackspaceIsPressed,
  DefaultSuperTextFieldKeyboardHandlers.deleteTextWhenBackspaceOrDeleteIsPressed,
];