Is it possible to neglect the key events in the Forge viewer, outside the viewer DOM element?
I have a separate DOM element with it's own key events, but they don't work, because the viewer events apply to the whole DOM (window). I can see that mouse events and key events are handled differently, but cannot understand why.
Lines 13015 - 13026 in viewer3D.js (v. 4.0):
// If we want to continue listenting to mouse movements outside of the window
// we need to tie our event listener to the window
this.domElement.addEventListener( 'mousewheel', this.mousewheel, false );
this.domElement.addEventListener( 'DOMMouseScroll', this.mousewheel, false ); // firefox
//** this.domElement.addEventListener( 'touchstart', function( event ) { _this.touchstart( event )}, false );
//** this.domElement.addEventListener( 'touchmove', function( event ) { _this.touchmove( event )}, false );
window.addEventListener( 'keydown', this.keydown, false );
window.addEventListener( 'keyup', this.keyup, false );
window.addEventListener( 'blur', this.blur, false );
There is probably a good intension here, but it would be really nice if it could be changed. If there is a smooth workaround please tell me, but I am stuck.