Exemplo n.º 1
0
        public RawMouseEventArgs(
            IInputDevice device,
            ILayoutRoot root,
            RawMouseEventType type,
            Point position)
            : base(device)
        {
            Contract.Requires <ArgumentNullException>(device != null);
            Contract.Requires <ArgumentNullException>(root != null);

            this.Root     = root;
            this.Position = position;
            this.Type     = type;
        }
Exemplo n.º 2
0
        public RawMouseEventArgs(
            IInputDevice device,
            uint timestamp,
            IInputRoot root,
            RawMouseEventType type,
            Point position, InputModifiers inputModifiers)
            : base(device, timestamp)
        {
            Contract.Requires <ArgumentNullException>(device != null);
            Contract.Requires <ArgumentNullException>(root != null);

            Root           = root;
            Position       = position;
            Type           = type;
            InputModifiers = inputModifiers;
        }
Exemplo n.º 3
0
        public RawMouseEventArgs(
            IInputDevice device,
            uint timestamp,
            IInputRoot root,
            RawMouseEventType type,
            Point position, InputModifiers inputModifiers)
            : base(device, timestamp)
        {
            Contract.Requires<ArgumentNullException>(device != null);
            Contract.Requires<ArgumentNullException>(root != null);

            Root = root;
            Position = position;
            Type = type;
            InputModifiers = inputModifiers;
        }
Exemplo n.º 4
0
            void MouseEvent(NSEvent ev, RawMouseEventType type)
            {
                BecomeFirstResponder();
                var loc = TranslateLocalPoint(ConvertPointToView(ev.LocationInWindow, this).ToAvaloniaPoint());
                var ts  = GetTimeStamp(ev);
                var mod = GetModifiers(ev.ModifierFlags);

                if (type == RawMouseEventType.Wheel)
                {
                    var delta = GetDelta(ev);
                    // ReSharper disable CompareOfFloatsByEqualityOperator
                    if (delta.X == 0 && delta.Y == 0)
                    {
                        return;
                    }
                    // ReSharper restore CompareOfFloatsByEqualityOperator
                    _tl.OnInput(new RawMouseWheelEventArgs(_mouse, ts, _tl.InputRoot, loc,
                                                           delta, mod));
                }
                else
                {
                    _tl.OnInput(new RawMouseEventArgs(_mouse, ts, _tl.InputRoot, type, loc, mod));
                }
            }
Exemplo n.º 5
0
 void MouseEvent(RawMouseEventType type, MouseEventArgs e)
 => _ttl.Input?.Invoke(new RawMouseEventArgs(_mouse, (uint)e.Timestamp, _inputRoot, type,
                                             e.GetPosition(this).ToAvaloniaPoint(), GetModifiers()));
Exemplo n.º 6
0
 public RawMouseEventArgs(MouseDevice device, RawMouseEventType type)
     : base(device, Environment.TickCount)
 {
     this.Type = type;
 }
Exemplo n.º 7
0
 public RawMouseEventArgs(MouseDevice device, RawMouseEventType type)
     : base(device, Environment.TickCount)
 {
     this.Type = type;
 }