Skip to content

Commit

Permalink
don't intercept cut via x in marquee strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
audionerd committed Oct 29, 2018
1 parent 85d935b commit 04d5870
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/js/window/storyboarder-sketch-pane/marquee-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,14 @@ class SelectionStrategy {

_onKeyDown (event) {
// TODO key bindings
// will require re-working the keyboard command interpreter for macOS
// due to the cmd key bug
// e.g.: if (this.context.isCommandPressed('drawing:marquee:copy')) {
//
// HACK hardcodes key handler
if (
// cut
(event.key === 'x' && (event.metaKey || event.ctrlKey)) ||
// copy
(event.key === 'c' && (event.metaKey || event.ctrlKey)) ||
// paste
Expand Down Expand Up @@ -450,27 +457,6 @@ class SelectionStrategy {
this.deselect()
}
}

// TODO key bindings
// TODO make this assignable to 'drawing:marquee:copy'
// will require re-working the keyboard command interpreter for macOS
// due to the cmd key bug
// if (this.context.isCommandPressed('drawing:marquee:copy')) {
//
// HACK hardcodes key handler to accept either Cmd+C or Ctrl+C
//
if (event.key === 'x' && (event.metaKey || event.ctrlKey)) {
if (this.parent.marqueePath) {
this.context.sketchPane.selectedArea.set(this.parent.marqueePath)
this.parent.copyToClipboard(
this.parent.marqueePath,
this.context.sketchPane.selectedArea.copy(this.context.visibleLayersIndices)
)
this.context.sketchPane.selectedArea.erase(this.context.visibleLayersIndices)
notifications.notify({ message: 'Cut selection', timing: 5 })
}
return
}
}

_onKeyUp (event) {
Expand Down

0 comments on commit 04d5870

Please sign in to comment.