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; }
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; }
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; }
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)); } }
void MouseEvent(RawMouseEventType type, MouseEventArgs e) => _ttl.Input?.Invoke(new RawMouseEventArgs(_mouse, (uint)e.Timestamp, _inputRoot, type, e.GetPosition(this).ToAvaloniaPoint(), GetModifiers()));
public RawMouseEventArgs(MouseDevice device, RawMouseEventType type) : base(device, Environment.TickCount) { this.Type = type; }