Skip to main content
Version: 1.0.0-preview.33

Velaptor.Input.MouseState

Velaptor

Velaptor.Input

MouseState Struct

Represents the state of the mouse.

public readonly struct MouseState

Constructors

MouseState(Point, bool, bool, bool, MouseScrollDirection, int) Constructor

Initializes a new instance of the MouseState struct.

public MouseState(System.Drawing.Point pos, bool isLeftButtonDown, bool isRightButtonDown, bool isMiddleButtonDown, Velaptor.Input.MouseScrollDirection scrollDirection, int scrollWheelValue);

Parameters

pos System.Drawing.Point

The position of the mouse.

isLeftButtonDown System.Boolean

True if the left button is down.

isRightButtonDown System.Boolean

True if the right button is down.

isMiddleButtonDown System.Boolean

True if the middle button is down.

scrollDirection MouseScrollDirection

The travel direction of the mouse wheel.

scrollWheelValue System.Int32

The value of the mouse wheel.

Methods

AnyButtonsDown()

Returns a value indicating whether or not any of the mouse buttons are in the down position.

public bool AnyButtonsDown();

Returns

System.Boolean
True if any buttons are in the down position.

GetButtonState(MouseButton)

Returns a value indicating whether or not the state for the given mouseButton
is in the down or up position.

public bool GetButtonState(Velaptor.Input.MouseButton mouseButton);

Parameters

mouseButton MouseButton

The button state to retrieve.

Returns

System.Boolean
true if the button is down.

GetPosition()

Gets or sets the position of the mouse.

public System.Drawing.Point GetPosition();

Returns

System.Drawing.Point
The position relative to the top left corner of the window.

GetScrollDirection()

Gets the direction that the mouse wheel has been turned.

public Velaptor.Input.MouseScrollDirection GetScrollDirection();

Returns

MouseScrollDirection
The scroll direction of the mouse wheel.

GetScrollWheelValue()

Gets the position value of the mouse scroll wheel.

public int GetScrollWheelValue();

Returns

System.Int32
The value of the scroll wheel.

GetX()

Gets or sets the X position of the mouse.

public int GetX();

Returns

System.Int32
The X position relative to the top left corner of the window.

GetY()

Gets or sets the Y position of the mouse.

public int GetY();

Returns

System.Int32
The Y position relative to the top left corner of the window.

IsButtonDown(MouseButton)

Returns a value indicating whether or not the given mouse button
is in the down position.

public bool IsButtonDown(Velaptor.Input.MouseButton button);

Parameters

button MouseButton

The mouse button to check.

Returns

System.Boolean
True if the mouse button is in the down position.

IsButtonUp(MouseButton)

Returns a value indicating whether or not the given mouse button
is in the up position.

public bool IsButtonUp(Velaptor.Input.MouseButton button);

Parameters

button MouseButton

The mouse button to check.

Returns

System.Boolean
True if the mouse button is in the up position.

Exceptions

System.ComponentModel.InvalidEnumArgumentException
Occurs if the MouseButton is an invalid value.

IsLeftButtonDown()

Gets or sets a value indicating whether or not the left mouse button is in the down position.

public bool IsLeftButtonDown();

Returns

System.Boolean
true if the button is down.

IsLeftButtonUp()

Returns a value indicating whether or not the left mouse button is in the up position.

public bool IsLeftButtonUp();

Returns

System.Boolean
true if the button is up.

IsMiddleButtonDown()

Gets or sets a value indicating whether or not the middle mouse button is in the down position.

public bool IsMiddleButtonDown();

Returns

System.Boolean
true if the button is down.

IsMiddleButtonUp()

Returns a value indicating whether or not the middle mouse button is in the up position.

public bool IsMiddleButtonUp();

Returns

System.Boolean
true if the button is up.

IsRightButtonDown()

Gets or sets a value indicating whether or not the right mouse button is in the down position.

public bool IsRightButtonDown();

Returns

System.Boolean
true if the button is down.

IsRightButtonUp()

Returns a value indicating whether or not the right mouse button is in the up position.

public bool IsRightButtonUp();

Returns

System.Boolean
true if the button is up.