Struct MouseInfo
Represents a structured mouse state.
public readonly struct MouseInfo : IEquatable<MouseInfo>, IEqualityComparer<MouseInfo>
- Implements
- Inherited Members
- Extension Methods
Constructors
MouseInfo(Point, MouseButtons, float)
Initializes a new instance of the MouseInfo struct.
public MouseInfo(Point position, MouseButtons buttonFlags = MouseButtons.None, float wheel = 0)
Parameters
positionPointPosition of the pointer.
buttonFlagsMouseButtonsFlags with pressed buttons.
wheelfloatWheel value.
Fields
ClickedButtons
Set of currently clicked buttons.
public readonly MouseButtons ClickedButtons
Field Value
Position
Position of the mouse cursor.
public readonly Point Position
Field Value
Wheel
Mouse wheel delta since last frame.
public readonly float Wheel
Field Value
Methods
Equals(MouseInfo)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MouseInfo other)
Parameters
otherMouseInfoAn object to compare with this object.
Returns
Equals(MouseInfo, MouseInfo)
Determines whether the specified objects are equal.
public bool Equals(MouseInfo x, MouseInfo y)
Parameters
xMouseInfoThe first object of type
Tto compare.yMouseInfoThe second object of type
Tto compare.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
GetHashCode(MouseInfo)
Returns a hash code for the specified object.
public int GetHashCode(MouseInfo obj)
Parameters
Returns
- int
A hash code for the specified object.
Exceptions
- ArgumentNullException
The type of
objis a reference type andobjis null.
IsDown(MouseButtons)
Detects if some of mouse buttons were clicked in this state.
public bool IsDown(MouseButtons key)
Parameters
keyMouseButtonsButtons to check.
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(MouseInfo, MouseInfo)
Checks if two MouseInfos are equal.
public static bool operator ==(MouseInfo left, MouseInfo right)
Parameters
Returns
operator !=(MouseInfo, MouseInfo)
Checks if two MouseInfos are equal.
public static bool operator !=(MouseInfo left, MouseInfo right)