replace canvasKeyPressEventArgs to canvasKeyDownEventArgs

This commit is contained in:
Mohit Bansal 2023-02-08 19:22:27 +05:30
parent f36d44dc67
commit cfa88b701f

View File

@ -2810,7 +2810,7 @@ function onCanvasKeyDown( event ) {
break; break;
case 119://w case 119://w
case 87://W case 87://W
if (!canvasKeyPressEventArgs.preventVerticalPan) { if (!canvasKeyDownEventArgs.preventVerticalPan) {
if ( event.shift ) { if ( event.shift ) {
this.viewport.zoomBy(1.1); this.viewport.zoomBy(1.1);
} else { } else {
@ -2822,7 +2822,7 @@ function onCanvasKeyDown( event ) {
break; break;
case 115://s case 115://s
case 83://S case 83://S
if (!canvasKeyPressEventArgs.preventVerticalPan) { if (!canvasKeyDownEventArgs.preventVerticalPan) {
if ( event.shift ) { if ( event.shift ) {
this.viewport.zoomBy(0.9); this.viewport.zoomBy(0.9);
} else { } else {
@ -2833,14 +2833,14 @@ function onCanvasKeyDown( event ) {
event.preventDefault = true; event.preventDefault = true;
break; break;
case 97://a case 97://a
if (!canvasKeyPressEventArgs.preventHorizontalPan) { if (!canvasKeyDownEventArgs.preventHorizontalPan) {
this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0))); this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0)));
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
event.preventDefault = true; event.preventDefault = true;
break; break;
case 100://d case 100://d
if (!canvasKeyPressEventArgs.preventHorizontalPan) { if (!canvasKeyDownEventArgs.preventHorizontalPan) {
this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(40, 0))); this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(40, 0)));
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }