Add keyboard shortcut to toggle grid (alt+G)

This commit is contained in:
juliandescottes 2018-09-19 23:05:45 +02:00 committed by Julian Descottes
parent bd0478fb35
commit 717e8dd52a
2 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@
this.container = container;
this.onionSkinShortcut = pskl.service.keyboard.Shortcuts.MISC.ONION_SKIN;
this.toggleGridShortcut = pskl.service.keyboard.Shortcuts.MISC.TOGGLE_GRID;
this.fpsRangeInput = document.querySelector('#preview-fps');
this.fpsCounterDisplay = document.querySelector('#display-fps');
@ -44,6 +45,7 @@
var registerShortcut = pskl.app.shortcutService.registerShortcut.bind(pskl.app.shortcutService);
registerShortcut(this.onionSkinShortcut, this.toggleOnionSkin_.bind(this));
registerShortcut(this.toggleGridShortcut, this.toggleGrid_.bind(this));
var onionSkinTooltip = pskl.utils.TooltipFormatter.format('Toggle onion skin', this.onionSkinShortcut);
this.toggleOnionSkinButton.setAttribute('title', onionSkinTooltip);

View File

@ -59,6 +59,7 @@
BEST_PREVIEW : createShortcut('best-preview', 'Select best size preview', 'alt+2'),
FULL_PREVIEW : createShortcut('full-preview', 'Select full size preview', 'alt+3'),
ONION_SKIN : createShortcut('onion-skin', 'Toggle onion skin', 'alt+O'),
TOGGLE_GRID : createShortcut('toggle-grid', 'Show/Hide grid', 'alt+G'),
LAYER_PREVIEW : createShortcut('layer-preview', 'Toggle layer preview', 'alt+L'),
MERGE_ANIMATION : createShortcut('import-animation', 'Open merge animation popup', 'ctrl+shift+M'),
CLOSE_POPUP : createShortcut('close-popup', 'Close an opened popup', 'ESC'),