Skip to content

Commit

Permalink
UX: invoke zoomIncrease shortcut on Ctrl + Plus (numpad)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksey-hoffman committed Jul 8, 2021
1 parent 194fec9 commit 4f90117
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1539,9 +1539,13 @@ export default {
else {
// Bind specified action to shortcuts
if (!value.isReadOnly) {
// Add additional (duplicate) listeners
if (value.shortcut === 'ctrl++') {
value.shortcut = ['ctrl++', 'ctrl+=']
}
mousetrap.bind(value.shortcut, (event) => {
this.$store.dispatch('SHORTCUT_ACTION', { event, value })
}, 'keydown')
}, value.eventName ?? 'keydown')
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// dialogIsOpened: Boolean
// dirItemIsSelected: Boolean
// }
// eventName: String ('keydown'|'keypress')

export default {
toggleApp: {
Expand Down Expand Up @@ -86,6 +87,7 @@ export default {
isGlobal: false,
isReadOnly: false,
conditions: {},
eventName: 'keypress',
preventDefaultType: 'always',
routes: ['all'],
icon: 'mdi-plus',
Expand Down
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ export default new Vuex.Store({
.replace(/\s/g, '')
.replace(/Delete/g, 'del')
.replace(/Backtick/g, '`')
.replace(/Plus/g, '=')
.replace(/Plus/g, '+')
.replace(/Minus/g, '-')
.replace(/</g, ',')
.replace(/>/g, '.')
Expand Down

0 comments on commit 4f90117

Please sign in to comment.