public void KeyDown(ViewportEvent e) { if (e.KeyCode == Keys.Space) { Viewport.Control.Cursor = Cursors.SizeAll; if (!CameraNavigationViewportSettings.Camera2DPanRequiresMouseClick) { Viewport.Control.Capture = true; var p = e.Sender.Control.PointToClient(Cursor.Position); _mouseDown = new Vector3(p.X, Viewport.Height - p.Y, 0); } e.Handled = true; } if (KeyboardState.Shift) { var shift = new Vector3(0, 0, 0); switch (e.KeyCode) { case Keys.Left: shift.X = -Viewport.Width / Camera.Zoom / 4; break; case Keys.Right: shift.X = Viewport.Width / Camera.Zoom / 4; break; case Keys.Up: shift.Y = Viewport.Height / Camera.Zoom / 4; break; case Keys.Down: shift.Y = -Viewport.Height / Camera.Zoom / 4; break; } Camera.Position += shift; } var str = e.KeyCode.ToString(); if (str.StartsWith("NumPad") || str.StartsWith("D")) { var last = str.Last(); if (Char.IsDigit(last)) { var press = (int)Char.GetNumericValue(last); if (press >= 0 && press <= 9) { if (press == 0) { press = 10; } var num = Math.Max(press - 6, 6 - press); var pow = (float)Math.Pow(2, num); var zoom = press < 6 ? 1 / pow : pow; Camera.Zoom = zoom; Oy.Publish("MapDocument:ViewportZoomStatus:UpdateValue", Camera.Zoom); } } } }
public void DragEnd(ViewportEvent e) { }
public void DragStart(ViewportEvent e) { }
public void DragMove(ViewportEvent e) { }
public void MouseDoubleClick(ViewportEvent e) { }