handleKeyboardCommand method
Handles a keyboard command for the selected canvas object.
Implementation
bool handleKeyboardCommand(
String key, {
bool control = false,
bool meta = false,
bool shift = false,
}) {
final shortcut = control || meta;
final normalized = key.toLowerCase();
if (shortcut && normalized == 'c') return copySelected();
if (shortcut && normalized == 'v') return pasteCopied().isNotEmpty;
if (key == 'Delete' || key == 'Backspace') return deleteSelected();
if (key == 'ArrowLeft') return nudgeSelected(dx: -1, largeStep: shift);
if (key == 'ArrowRight') return nudgeSelected(dx: 1, largeStep: shift);
if (key == 'ArrowUp') return nudgeSelected(dy: -1, largeStep: shift);
if (key == 'ArrowDown') return nudgeSelected(dy: 1, largeStep: shift);
return false;
}