Skip to content

Commit

Permalink
Limit keyboard shortcuts to single modifier key (#959)
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Nusser <hubsif@gmx.de>
  • Loading branch information
hubsif authored Mar 15, 2021
1 parent c556597 commit 2f3dc61
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default {
}
},
keyDown (ev) {
if (ev.ctrlKey || ev.metaKey) {
if ((ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
switch (ev.keyCode) {
case 80:
this.widgetPropsOpened = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default {
}
},
keyDown (ev) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey)) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
this.save()
ev.stopPropagation()
ev.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
this.$store.dispatch('stopTrackingStates')
},
keyDown (ev) {
if (ev.ctrlKey || ev.metaKey) {
if ((ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
switch (ev.keyCode) {
case 82:
this.togglePreviewMode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default {
this.detailsOpened = false
},
keyDown (ev) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey)) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
this.save(!this.createMode)
ev.stopPropagation()
ev.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export default {
this.eventSource = null
},
keyDown (ev) {
if (ev.ctrlKey || ev.metaKey) {
if ((ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
if (this.currentModule) return
switch (ev.keyCode) {
case 68:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export default {
this.eventSource = null
},
keyDown (ev) {
if (ev.ctrlKey || ev.metaKey) {
if ((ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
switch (ev.keyCode) {
case 66:
if (this.isBlockly) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
}
},
keyDown (ev) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey)) {
if (ev.keyCode === 83 && (ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
this.save()
ev.stopPropagation()
ev.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export default {
})
},
keyDown (ev) {
if (ev.ctrlKey || ev.metaKey) {
if ((ev.ctrlKey || ev.metaKey) && !(ev.altKey || ev.shiftKey)) {
switch (ev.keyCode) {
case 68:
this.toggleDisabled()
Expand Down

0 comments on commit 2f3dc61

Please sign in to comment.