本文整理汇总了C#中System.Windows.Forms.KeyEventArgs.ToTEKeyArgs方法的典型用法代码示例。如果您正苦于以下问题:C# KeyEventArgs.ToTEKeyArgs方法的具体用法?C# KeyEventArgs.ToTEKeyArgs怎么用?C# KeyEventArgs.ToTEKeyArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.KeyEventArgs
的用法示例。
在下文中一共展示了KeyEventArgs.ToTEKeyArgs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnKeyUp
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;
}
示例2: OnKeyDown
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);
}
}