Skip to content

Commit

Permalink
update: name event listener to possibly access it elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Aug 21, 2023
1 parent ad7deb3 commit d4a6a3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions editor/js/Sidebar.Settings.Shortcuts.js
Expand Up @@ -95,13 +95,13 @@ function SidebarSettingsShortcuts( editor ) {

}

document.getElementById( 'threejs-editor' ).addEventListener( 'keydown', function ( event ) {
function shortcutsListener( event ) {

switch ( event.key.toLowerCase() ) {

case 'backspace':

event.preventDefault(); // prevent browser back -- this is no longer an issue since 2016
// event.preventDefault(); // prevent browser back -- this is no longer an issue since 2016

// fall-through

Expand Down Expand Up @@ -172,7 +172,9 @@ function SidebarSettingsShortcuts( editor ) {

}

} );
}

document.addEventListener( 'keydown', shortcutsListener );

return container;

Expand Down

0 comments on commit d4a6a3f

Please sign in to comment.