本文整理汇总了C#中NSEvent.ToXwtKeyEventArgs方法的典型用法代码示例。如果您正苦于以下问题:C# NSEvent.ToXwtKeyEventArgs方法的具体用法?C# NSEvent.ToXwtKeyEventArgs怎么用?C# NSEvent.ToXwtKeyEventArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSEvent
的用法示例。
在下文中一共展示了NSEvent.ToXwtKeyEventArgs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KeyDown
public override void KeyDown(NSEvent theEvent)
{
var keyArgs = theEvent.ToXwtKeyEventArgs ();
context.InvokeUserCode (delegate {
eventSink.OnKeyPressed (keyArgs);
});
if (keyArgs.Handled)
return;
var textArgs = new PreviewTextInputEventArgs (theEvent.Characters);
if (!String.IsNullOrEmpty(theEvent.Characters))
context.InvokeUserCode (delegate {
eventSink.OnPreviewTextInput (textArgs);
});
if (textArgs.Handled)
return;
base.KeyDown (theEvent);
}
示例2: KeyUp
public override void KeyUp (NSEvent theEvent)
{
var keyArgs = theEvent.ToXwtKeyEventArgs ();
context.InvokeUserCode (delegate {
eventSink.OnKeyReleased (keyArgs);
});
if (!keyArgs.Handled)
base.KeyUp (theEvent);
}
示例3: PerformKeyEquivalent
public override bool PerformKeyEquivalent (NSEvent theEvent)
{
var popupHandled = SendKeyPressed (theEvent.ToXwtKeyEventArgs ());
if (popupHandled)
return true;
return base.PerformKeyEquivalent (theEvent);;
}
示例4: PerformKeyEquivalent
public override bool PerformKeyEquivalent (NSEvent theEvent)
{
return SendKeyPressed (theEvent.ToXwtKeyEventArgs ()) || base.PerformKeyEquivalent (theEvent);
}
示例5: PerformKeyEquivalent
public override bool PerformKeyEquivalent (NSEvent theEvent)
{
var popupHandled = SendKeyPressed (theEvent.ToXwtKeyEventArgs ());
LogMessage ($"Popup handled {popupHandled}");
if (popupHandled)
return true;
var baseHandled = base.PerformKeyEquivalent (theEvent);;
LogMessage ($"Base handled {baseHandled}");
LogMessage ($"First Reponder {NSApplication.SharedApplication?.KeyWindow?.FirstResponder}");
LogMessage ($"Refuses First Responder {RefusesFirstResponder}");
LogMessage ($"Editor chain {CurrentEditor}");
return baseHandled;
}
示例6: PerformKeyEquivalent
public override bool PerformKeyEquivalent (NSEvent theEvent)
{
var popupHandled = SendKeyPressed (theEvent.ToXwtKeyEventArgs ());
LogMessage ($"Popup handled {popupHandled}");
if (popupHandled)
return true;
var baseHandled = base.PerformKeyEquivalent (theEvent);;
LogMessage ($"Base handled {baseHandled}");
return baseHandled;
}