setShortcut method

void setShortcut(
  1. LogicalKeySet keySet,
  2. String actionId
)

Sets or updates a keyboard shortcut.

Maps a key combination to an action ID. If the shortcut already exists, it will be reassigned to the new action.

Parameters:

  • keySet: The key combination (e.g., Cmd+S)
  • actionId: The ID of the action to execute

Example:

manager.setShortcut(
  LogicalKeySet(LogicalKeyboardKey.keyS, LogicalKeyboardKey.meta),
  'save_graph',
);

Implementation

void setShortcut(LogicalKeySet keySet, String actionId) {
  _shortcuts[keySet] = actionId;
}