shortcut property

PlutoGridShortcut shortcut
final

Set custom shortcut keys.

Refer to the code below to redefine the action of a specific key or add a new shortcut action. The example code below overrides the enter key behavior.

shortcut: PlutoGridShortcut(
  actions: {
    ...PlutoGridShortcut.defaultActions,
    LogicalKeySet(LogicalKeyboardKey.enter): CustomEnterKeyAction(),
  },
),

class CustomEnterKeyAction extends PlutoGridShortcutAction {
  @override
  void execute({
    required PlutoKeyManagerEvent keyEvent,
    required PlutoGridStateManager stateManager,
  }) {
    print('Pressed enter key.');
  }
}

Implementation

final PlutoGridShortcut shortcut;