Extends shortcut for opening & closing the studio

- Should support alt + \ in most cases
- Corrects the shortcut in log message when the studio is hidden
This commit is contained in:
Jørn Myrland 2021-10-12 18:46:15 +02:00 committed by Aria
parent 2e4ae0c860
commit 81578f7925
2 changed files with 7 additions and 2 deletions

View file

@ -71,7 +71,7 @@ export default function UIRoot() {
useEffect(() => { useEffect(() => {
if (visiblityState === 'everythingIsHidden') { if (visiblityState === 'everythingIsHidden') {
console.warn( console.warn(
`Theatre Studio is hidden. You can restore it by either hitting alt/option+\` or calling studio.ui.restore()`, `Theatre Studio is hidden. Use the keyboard shortcut 'alt + \\' to restore the studio, or call studio.ui.restore().`,
) )
} }
return () => {} return () => {}

View file

@ -44,7 +44,12 @@ export default function useKeyboardShortcuts() {
} else { } else {
return return
} }
} else if (e.key === `'` && e.altKey) { }
// alt + \
else if (
e.altKey &&
(e.key === '\\' || e.code === 'Backslash' || e.code === 'IntlBackslash')
) {
studio.transaction(({stateEditors, drafts}) => { studio.transaction(({stateEditors, drafts}) => {
stateEditors.studio.ahistoric.setVisibilityState( stateEditors.studio.ahistoric.setVisibilityState(
drafts.ahistoric.visibilityState === 'everythingIsHidden' drafts.ahistoric.visibilityState === 'everythingIsHidden'