defaultTextFieldKeyboardHandlers top-level constant
The keyboard actions that a SuperTextField uses by default.
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,
...defaultTextfieldKeyboardActions,
],
);
Implementation
const defaultTextFieldKeyboardHandlers = <TextFieldKeyboardHandler>[
DefaultSuperTextFieldKeyboardHandlers.scrollOnPageUp,
DefaultSuperTextFieldKeyboardHandlers.scrollOnPageDown,
DefaultSuperTextFieldKeyboardHandlers.scrollToBeginningOfDocumentOnCtrlOrCmdAndHome,
DefaultSuperTextFieldKeyboardHandlers.scrollToEndOfDocumentOnCtrlOrCmdAndEnd,
DefaultSuperTextFieldKeyboardHandlers.scrollToBeginningOfDocumentOnHomeOnMacOrWeb,
DefaultSuperTextFieldKeyboardHandlers.scrollToEndOfDocumentOnEndOnMacOrWeb,
DefaultSuperTextFieldKeyboardHandlers.copyTextWhenCmdCIsPressed,
DefaultSuperTextFieldKeyboardHandlers.pasteTextWhenCmdVIsPressed,
DefaultSuperTextFieldKeyboardHandlers.selectAllTextFieldWhenCmdAIsPressed,
DefaultSuperTextFieldKeyboardHandlers.moveCaretToStartOrEnd,
DefaultSuperTextFieldKeyboardHandlers.moveUpDownLeftAndRightWithArrowKeys,
DefaultSuperTextFieldKeyboardHandlers.moveToLineStartWithHome,
DefaultSuperTextFieldKeyboardHandlers.moveToLineEndWithEnd,
DefaultSuperTextFieldKeyboardHandlers.deleteWordWhenAltBackSpaceIsPressedOnMac,
DefaultSuperTextFieldKeyboardHandlers.deleteWordWhenCtlBackSpaceIsPressedOnWindowsAndLinux,
DefaultSuperTextFieldKeyboardHandlers.deleteTextOnLineBeforeCaretWhenShortcutKeyAndBackspaceIsPressed,
DefaultSuperTextFieldKeyboardHandlers.deleteTextWhenBackspaceOrDeleteIsPressed,
DefaultSuperTextFieldKeyboardHandlers.insertNewlineWhenEnterIsPressed,
DefaultSuperTextFieldKeyboardHandlers.blockControlKeys,
DefaultSuperTextFieldKeyboardHandlers.insertCharacterWhenKeyIsPressed,
];