Table of Contents

Struct MouseInfo

Namespace
Icy.Input.Devices
Assembly
IcyUI.dll

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

position Point

Position of the pointer.

buttonFlags MouseButtons

Flags with pressed buttons.

wheel float

Wheel value.

Fields

ClickedButtons

Set of currently clicked buttons.

public readonly MouseButtons ClickedButtons

Field Value

MouseButtons

Position

Position of the mouse cursor.

public readonly Point Position

Field Value

Point

Wheel

Mouse wheel delta since last frame.

public readonly float Wheel

Field Value

float

Methods

Equals(MouseInfo)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MouseInfo other)

Parameters

other MouseInfo

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(MouseInfo, MouseInfo)

Determines whether the specified objects are equal.

public bool Equals(MouseInfo x, MouseInfo y)

Parameters

x MouseInfo

The first object of type T to compare.

y MouseInfo

The second object of type T to compare.

Returns

bool

true if the specified objects are equal; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

obj MouseInfo

The object for which a hash code is to be returned.

Returns

int

A hash code for the specified object.

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.

IsDown(MouseButtons)

Detects if some of mouse buttons were clicked in this state.

public bool IsDown(MouseButtons key)

Parameters

key MouseButtons

Buttons to check.

Returns

bool

true if the button is clicked, false otherwise.

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

left MouseInfo

Left operand.

right MouseInfo

Right operand.

Returns

bool

true if first MouseInfo is equal to second, false otherwise.

operator !=(MouseInfo, MouseInfo)

Checks if two MouseInfos are equal.

public static bool operator !=(MouseInfo left, MouseInfo right)

Parameters

left MouseInfo

Left operand.

right MouseInfo

Right operand.

Returns

bool

true if first MouseInfo is equal to second, false otherwise.