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
 public override void KeyDown(NSEvent theEvent)
 {
     Context.InvokeUserCode(delegate {
         EventSink.OnKeyPressed(theEvent.ToXwtKeyEventArgs());
     });
     base.KeyDown(theEvent);
 }
Пример #3
0
		public override void KeyUp (NSEvent theEvent)
		{
			var keyArgs = theEvent.ToXwtKeyEventArgs ();
			context.InvokeUserCode (delegate {
				eventSink.OnKeyReleased (keyArgs);
			});
			if (!keyArgs.Handled)
				base.KeyUp (theEvent);
		}
Пример #4
0
        public override bool PerformKeyEquivalent(NSEvent theEvent)
        {
            var popupHandled = SendKeyPressed(theEvent.ToXwtKeyEventArgs());

            if (popupHandled)
            {
                return(true);
            }
            return(base.PerformKeyEquivalent(theEvent));;
        }
Пример #5
0
 public override void KeyUp(NSEvent theEvent)
 {
     if (cachedCursorPosition != SelectedRange.Location)
     {
         cachedCursorPosition = SelectedRange.Location;
         Context.InvokeUserCode(delegate {
             EventSink.OnSelectionChanged();
             EventSink.OnKeyReleased(theEvent.ToXwtKeyEventArgs());
         });
     }
     base.KeyUp(theEvent);
 }
Пример #6
0
 public static bool HandleKeyUp(this ICellRenderer cell, NSEvent theEvent)
 {
     if (cell.Backend.GetIsEventEnabled(WidgetEvent.KeyReleased))
     {
         cell.Backend.Load(cell);
         cell.CellContainer.SetCurrentEventRow();
         var keyArgs = theEvent.ToXwtKeyEventArgs();
         cell.Backend.Context.InvokeUserCode(() => cell.Backend.EventSink.OnKeyReleased(keyArgs));
         return(keyArgs.Handled);
     }
     return(false);
 }
Пример #7
0
        public override void KeyDown(NSEvent theEvent)
        {
            var key = theEvent.ToXwtKeyEventArgs().Key;

            if ((key == Key.Return || key == Key.Space) && Clicked != null)
            {
                Clicked(this, EventArgs.Empty);
            }
            else
            {
                base.KeyDown(theEvent);
            }
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
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);
        }
Пример #11
0
        public static bool HandleKeyDown(this IViewObject view, NSEvent theEvent)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (theEvent == null)
            {
                throw new ArgumentNullException(nameof(theEvent));
            }
            if (view.View == null)
            {
                throw new InvalidOperationException();
            }

            var keyArgs = theEvent.ToXwtKeyEventArgs();

            view.Backend.ApplicationContext.InvokeUserCode(delegate {
                view.Backend.EventSink.OnKeyPressed(keyArgs);
            });
            if (keyArgs.Handled)
            {
                return(true);
            }

            var textArgs = new TextInputEventArgs(theEvent.Characters);

            if (!String.IsNullOrEmpty(theEvent.Characters))
            {
                view.Backend.ApplicationContext.InvokeUserCode(delegate {
                    view.Backend.EventSink.OnTextInput(textArgs);
                });
            }
            if (textArgs.Handled)
            {
                return(true);
            }

            return(false);
        }
Пример #12
0
        public static bool HandleKeyUp(this IViewObject view, NSEvent theEvent)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (theEvent == null)
            {
                throw new ArgumentNullException(nameof(theEvent));
            }
            if (view.View == null)
            {
                throw new InvalidOperationException();
            }

            var keyArgs = theEvent.ToXwtKeyEventArgs();

            view.Backend.ApplicationContext.InvokeUserCode(delegate {
                view.Backend.EventSink.OnKeyReleased(keyArgs);
            });
            return(keyArgs.Handled);
        }
Пример #13
0
		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;
		}
Пример #14
0
		public override void KeyUp (NSEvent theEvent)
		{
			var keyArgs = theEvent.ToXwtKeyEventArgs ();
			context.InvokeUserCode (delegate {
				eventSink.OnKeyReleased (keyArgs);
			});
			if (!keyArgs.Handled)
				base.KeyUp (theEvent);
		}
Пример #15
0
		public override bool PerformKeyEquivalent (NSEvent theEvent)
		{
			var popupHandled = SendKeyPressed (theEvent.ToXwtKeyEventArgs ());
			if (popupHandled)
				return true;
			return base.PerformKeyEquivalent (theEvent);;
		}
Пример #16
0
 public override bool PerformKeyEquivalent(NSEvent theEvent)
 {
     return(SendKeyPressed(theEvent.ToXwtKeyEventArgs()) || base.PerformKeyEquivalent(theEvent));
 }
Пример #17
0
		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;
		}
Пример #18
0
		public override bool PerformKeyEquivalent (NSEvent theEvent)
		{
			return SendKeyPressed (theEvent.ToXwtKeyEventArgs ()) || base.PerformKeyEquivalent (theEvent);
		}