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); }
void HandleTextInput(object sender, PreviewTextInputEventArgs e) { text += e.Text; e.Handled = true; QueueDraw(); }
void WidgetPreviewTextInputHandler(object sender, System.Windows.Input.TextCompositionEventArgs e) { PreviewTextInputEventArgs args = new PreviewTextInputEventArgs(e.Text); Context.InvokeUserCode(delegate { eventSink.OnPreviewTextInput(args); }); if (args.Handled) { e.Handled = true; } }
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); }
void WidgetPreviewTextInputHandler (object sender, System.Windows.Input.TextCompositionEventArgs e) { PreviewTextInputEventArgs args = new PreviewTextInputEventArgs(e.Text); Context.InvokeUserCode(delegate { eventSink.OnPreviewTextInput(args); }); if (args.Handled) e.Handled = true; }