Browse Source

Corrected PointerPointProperties inline documentation (#19062)

Made PointerEventArgs.Properties public, to better support pattern matching
release/11.3.2
Tom Edwards 8 months ago
committed by Julien Lebosquain
parent
commit
c2142c62bb
  1. 4
      src/Avalonia.Base/Input/PointerEventArgs.cs
  2. 34
      src/Avalonia.Base/Input/PointerPoint.cs

4
src/Avalonia.Base/Input/PointerEventArgs.cs

@ -143,9 +143,9 @@ namespace Avalonia.Input
} }
/// <summary> /// <summary>
/// Returns the current pointer point properties /// Gets the state the pointer device had when this event occurred.
/// </summary> /// </summary>
protected PointerPointProperties Properties => _properties; public PointerPointProperties Properties => _properties;
} }
public enum MouseButton public enum MouseButton

34
src/Avalonia.Base/Input/PointerPoint.cs

@ -31,7 +31,7 @@ namespace Avalonia.Input
} }
/// <summary> /// <summary>
/// Provides extended properties for a PointerPoint object. /// Describes the state of a pointer device when it generated a specific input.
/// </summary> /// </summary>
public record struct PointerPointProperties public record struct PointerPointProperties
{ {
@ -41,47 +41,47 @@ namespace Avalonia.Input
public Rect ContactRect { get; } public Rect ContactRect { get; }
/// <summary> /// <summary>
/// Gets a value that indicates whether the pointer input was triggered by the primary action mode of an input device. /// Gets whether the device's primary action (e.g. <see cref="MouseButton.Left"/>) was active when this input occurred.
/// </summary> /// </summary>
public bool IsLeftButtonPressed { get; } = false; public bool IsLeftButtonPressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the pointer input was triggered by the tertiary action mode of an input device. /// Gets whether the device's tertiary action (e.g. <see cref="MouseButton.Middle"/>) was active when this input occurred.
/// </summary> /// </summary>
public bool IsMiddleButtonPressed { get; } = false; public bool IsMiddleButtonPressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the pointer input was triggered by the secondary action mode (if supported) of an input device. /// Gets whether the device's secondary action (e.g. <see cref="MouseButton.Right"/>) was active when this input occurred.
/// </summary> /// </summary>
public bool IsRightButtonPressed { get; } = false; public bool IsRightButtonPressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the pointer input was triggered by the first extended mouse button (XButton1). /// Gets whether the device's first extended action (e.g. <see cref="MouseButton.XButton1"/>) was active when this input occurred.
/// </summary> /// </summary>
public bool IsXButton1Pressed { get; } = false; public bool IsXButton1Pressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the pointer input was triggered by the second extended mouse button (XButton2). /// Gets whether the device's second extended action (e.g. <see cref="MouseButton.XButton2"/>) was active when this input occurred.
/// </summary> /// </summary>
public bool IsXButton2Pressed { get; } = false; public bool IsXButton2Pressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the barrel button of the pen/stylus device is pressed. /// Gets whether the barrel button of the pen/stylus device was pressed when this input occurred.
/// </summary> /// </summary>
public bool IsBarrelButtonPressed { get; } = false; public bool IsBarrelButtonPressed { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the input is from a pen eraser. /// Gets whether the input was generated by the use of a pen eraser.
/// </summary> /// </summary>
public bool IsEraser { get; } = false; public bool IsEraser { get; } = false;
/// <summary> /// <summary>
/// Gets a value that indicates whether the digitizer pen is inverted. /// Gets whether the input was generated by an inverted digitizer pen.
/// </summary> /// </summary>
public bool IsInverted { get; } = false; public bool IsInverted { get; } = false;
/// <summary> /// <summary>
/// Gets the clockwise rotation in degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers). /// Gets the clockwise rotation in degrees of the pen around its own major axis (such as when the user spins the pen in their fingers) when this input occurred.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// A value between 0.0 and 359.0 in degrees of rotation. The default value is 0.0. /// A value between 0.0 and 359.0 in degrees of rotation. The default value is 0.0.
@ -89,7 +89,7 @@ namespace Avalonia.Input
public float Twist { get; } = 0.0F; public float Twist { get; } = 0.0F;
/// <summary> /// <summary>
/// Gets a value that indicates the force that the pointer device (typically a pen/stylus) exerts on the surface of the digitizer. /// Gets the force that the pointer device (typically a pen/stylus) was exerting on the surface of the digitizer when this input occurred.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// A value from 0 to 1.0. The default value is 0.5. /// A value from 0 to 1.0. The default value is 0.5.
@ -97,23 +97,17 @@ namespace Avalonia.Input
public float Pressure { get; } = 0.5f; public float Pressure { get; } = 0.5f;
/// <summary> /// <summary>
/// Gets the plane angle between the Y-Z plane and the plane that contains the Y axis and the axis of the input device (typically a pen/stylus). /// Gets how many degrees of rotation the pen/stylus was tilted left (negative values) or right (positive values) when this input occurred.
/// </summary> /// </summary>
/// <returns>
/// The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted to the right of perpendicular, and between 0.0 and -90.0 when tilted to the left of perpendicular. The default value is 0.0.
/// </returns>
public float XTilt { get; } = 0.0F; public float XTilt { get; } = 0.0F;
/// <summary> /// <summary>
/// Gets the plane angle between the X-Z plane and the plane that contains the X axis and the axis of the input device (typically a pen/stylus). /// Gets how many degrees of rotation the pen/stylus was tilted up (negative values) or down (positive values) when this input occurred.
/// </summary> /// </summary>
/// <returns>
/// The value is 0.0 when the finger or pen is perpendicular to the digitizer surface, between 0.0 and 90.0 when tilted towards the user, and between 0.0 and -90.0 when tilted away from the user. The default value is 0.0.
/// </returns>
public float YTilt { get; } = 0.0F; public float YTilt { get; } = 0.0F;
/// <summary> /// <summary>
/// Gets the kind of pointer state change. /// Gets the state change that triggered this input. This is typically a button press or release.
/// </summary> /// </summary>
public PointerUpdateKind PointerUpdateKind { get; } = PointerUpdateKind.LeftButtonPressed; public PointerUpdateKind PointerUpdateKind { get; } = PointerUpdateKind.LeftButtonPressed;

Loading…
Cancel
Save