Skip to main content

MouseEvent struct

Namespace: Arlecchino.Input · Assembly: Arlecchino.Core

A mouse report from the terminal. Coordinates are frame cells — the same ones Surface.WriteAt and SurfaceRegion.Contains use, so hit-testing is comparing numbers.

public readonly struct MouseEvent : IEquatable<MouseEvent>

Implements IEquatable<T><MouseEvent>

Constructors

MemberSummary
MouseEvent(MouseAction, MouseButton, int, int, KeyModifiers)A mouse report from the terminal. Coordinates are frame cells — the same ones Surface.WriteAt and SurfaceRegion.Contains use, so hit-testing is comparing numbers.

Properties

MemberSummary
ActionWhat the mouse did.
ButtonWhich button, or MouseButton.None for the wheel.
ColumnZero-based column in the frame.
IsLeftClickWhether this is the left button going down — the usual "click" test.
IsScrollWhether this is a wheel event in either direction.
ModifiersModifiers held at the time.
RowZero-based row in the frame.

Methods

MemberSummary
Deconstruct(out MouseAction, out MouseButton, out int, out int, out KeyModifiers)

Constructors in detail

MouseEvent(MouseAction, MouseButton, int, int, KeyModifiers)

public MouseEvent(
MouseAction Action,
MouseButton Button,
int Row,
int Column,
KeyModifiers Modifiers);

A mouse report from the terminal. Coordinates are frame cells — the same ones Surface.WriteAt and SurfaceRegion.Contains use, so hit-testing is comparing numbers.

Parameters

NameTypeDescription
ActionMouseActionWhat the mouse did.
ButtonMouseButtonWhich button, or MouseButton.None for the wheel.
RowintZero-based row in the frame.
ColumnintZero-based column in the frame.
ModifiersKeyModifiersModifiers held at the time.

Properties in detail

Action

public MouseAction Action { get; init; }

What the mouse did.

Type MouseAction

Button

public MouseButton Button { get; init; }

Which button, or MouseButton.None for the wheel.

Type MouseButton

Column

public int Column { get; init; }

Zero-based column in the frame.

Type int

IsLeftClick

public bool IsLeftClick { get; }

Whether this is the left button going down — the usual "click" test.

Type bool

IsScroll

public bool IsScroll { get; }

Whether this is a wheel event in either direction.

Type bool

Modifiers

public KeyModifiers Modifiers { get; init; }

Modifiers held at the time.

Type KeyModifiers

Row

public int Row { get; init; }

Zero-based row in the frame.

Type int

Methods in detail

Deconstruct(out MouseAction, out MouseButton, out int, out int, out KeyModifiers)

public void Deconstruct(
out MouseAction Action,
out MouseButton Button,
out int Row,
out int Column,
out KeyModifiers Modifiers);

Parameters

NameTypeDescription
ActionMouseAction
ButtonMouseButton
Rowint
Columnint
ModifiersKeyModifiers