diff --git a/examples/js/controls/OrbitControls.js b/examples/js/controls/OrbitControls.js index d604a0d39fb49d72e1a32a7ed3bcaba999ecf6aa..b2a6f03de4afc1b6e32f22932fee16347e89e58b 100644 --- a/examples/js/controls/OrbitControls.js +++ b/examples/js/controls/OrbitControls.js @@ -539,34 +539,42 @@ THREE.OrbitControls = function ( object, domElement ) { //console.log( 'handleKeyDown' ); - // prevent the browser from scrolling on cursor up/down - - event.preventDefault(); + var update = false; switch ( event.keyCode ) { case scope.keys.UP: pan( 0, scope.keyPanSpeed ); - scope.update(); + update = true; break; case scope.keys.BOTTOM: pan( 0, - scope.keyPanSpeed ); - scope.update(); + update = true; break; case scope.keys.LEFT: pan( scope.keyPanSpeed, 0 ); - scope.update(); + update = true; break; case scope.keys.RIGHT: pan( - scope.keyPanSpeed, 0 ); - scope.update(); + update = true; break; } + if ( update ) { + + // prevent the browser from scrolling on cursor keys + + event.preventDefault(); + scope.update(); + + } + + } function handleTouchStartRotate( event ) {