Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/core/services/keyboard_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ class KeyboardService {
bool get isShiftPressed =>
isKeyPressed(LogicalKeyboardKey.shiftLeft) ||
isKeyPressed(LogicalKeyboardKey.shiftRight);

/// Returns `true` if either Alt key is currently pressed.
///
/// This includes:
/// - [LogicalKeyboardKey.altLeft]
/// - [LogicalKeyboardKey.altRight]
bool get isAltPressed =>
isKeyPressed(LogicalKeyboardKey.altLeft) ||
isKeyPressed(LogicalKeyboardKey.altRight);
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class CropDesktopInteractionManager {
_shiftDown = true;
break;
case 'Z':
if (_ctrlDown) onUndoRedo(!_shiftDown);
if (_ctrlDown && !HardwareKeyboard.instance.isAltPressed) {
onUndoRedo(!_shiftDown);
}
break;
}
} else if (event is KeyUpEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class DesktopInteractionManager {
_keyboardRotate(isLeftRotation: false, selectedLayers: selectedLayers);
break;
case 'Z':
if (_keyboard.isCtrlPressed) onUndoRedo(!_keyboard.isShiftPressed);
if (_keyboard.isCtrlPressed && !_keyboard.isAltPressed) {
onUndoRedo(!_keyboard.isShiftPressed);
}
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class PaintDesktopInteractionManager {
_shiftDown = true;
break;
case 'Z':
if (_ctrlDown) onUndoRedo(!_shiftDown);
if (_ctrlDown && !HardwareKeyboard.instance.isAltPressed) {
onUndoRedo(!_shiftDown);
}
break;
}
} else if (event is KeyUpEvent) {
Expand Down