diff --git a/src/viewer.js b/src/viewer.js index e3bc1eec..046f3d23 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2657,8 +2657,8 @@ function onCanvasKeyDown( event ) { var canvasKeyDownEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: !this.panVertical, - preventHorizontalPan: !this.panHorizontal + preventVerticalPan: event.preventVerticalPan || !this.panVertical, + preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal }; /** @@ -2728,8 +2728,8 @@ function onCanvasKeyPress( event ) { var canvasKeyPressEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: !this.panVertical, - preventHorizontalPan: !this.panHorizontal + preventVerticalPan: event.preventVerticalPan || !this.panVertical, + preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal }; // This event is documented in onCanvasKeyDown diff --git a/test/demo/basic.html b/test/demo/basic.html index f18a40e9..4fe267bd 100644 --- a/test/demo/basic.html +++ b/test/demo/basic.html @@ -21,7 +21,7 @@