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
0
            void HandleTextInput(object sender, PreviewTextInputEventArgs e)
            {
                text     += e.Text;
                e.Handled = true;

                QueueDraw();
            }
示例#3
0
        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;
            }
        }
示例#4
0
        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);
        }
示例#5
0
		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;
		}