protected override void OnKeyUp(KeyEventArgs e) { //base.OnKeyUp(e); // route event to current tool TEKeyArgs ee = e.ToTEKeyArgs(); TheOverlayModel.CurrentTool.KeyUp(ee); e.Handled = ee.Handled; // turn on raster on Alt released Rasterizer.View.OverrideWithZeroGridWidth = Control.ModifierKeys.HasFlag(Keys.Alt) && !Control.ModifierKeys.HasFlag(Keys.Shift); Rasterizer.View.OverrideWithHalfGridWidth = Control.ModifierKeys.HasFlag(Keys.Alt) && Control.ModifierKeys.HasFlag(Keys.Shift); if (e.KeyCode == Keys.Alt ) e.Handled = true; }
protected override void OnKeyDown(KeyEventArgs e) { //base.OnKeyDown(e); TEKeyArgs ee = e.ToTEKeyArgs(); TheOverlayModel.CurrentTool.KeyDown(ee); e.Handled = ee.Handled; // turn off raster on Alt Rasterizer.View.OverrideWithZeroGridWidth = Control.ModifierKeys.HasFlag(Keys.Alt) && !Control.ModifierKeys.HasFlag(Keys.Shift); Rasterizer.View.OverrideWithHalfGridWidth = Control.ModifierKeys.HasFlag(Keys.Alt) && Control.ModifierKeys.HasFlag(Keys.Shift); if (e.KeyCode == Keys.Alt ) e.Handled = true; if (!e.Handled) { // escape cancels current operation if (e.KeyCode == Keys.Escape) TheOverlayModel.ActivateDefaultTool(); if (e.KeyCode == Keys.C && e.Control) TheOverlayModel.PerformCodeBlockOperation(PdfOverlayModel.CodeBlockAction.Copy); else if (e.KeyCode == Keys.X && e.Control) TheOverlayModel.PerformCodeBlockOperation(PdfOverlayModel.CodeBlockAction.Cut); else if (e.KeyCode == Keys.V && e.Control) GlobalUI.UI.ShowMessageBox( "Currently pasting directly in the WYSIWYG area is not possible. However, you can paste into the code (text) field.", "Paste not possible", MessageBoxButtons.OK, MessageBoxIcon.Information); else if (e.KeyCode == Keys.Delete) TheOverlayModel.PerformCodeBlockOperation(PdfOverlayModel.CodeBlockAction.Delete); } }