Skip to content

InputAPI reference

Class KeyChord

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.dll
Guide: Input

A key pressed while a modifier is held: new KeyChord(Key.Enter, Key.LeftAlt, Key.RightAlt) is Alt+Enter with either Alt key. The chord is down while Key and any one of Modifiers are down.

C#
public sealed record KeyChord : IEquatable<KeyChord>

Inheritance

object ← KeyChord

Implements

IEquatable<KeyChord>

Constructors

KeyChord(Key, params Key[])

A chord of key with any one of modifiers (at least one).

C#
public KeyChord(Key key, params Key[] modifiers)

Parameters

key Key

modifiers Key[]

Exceptions

ArgumentException

No modifier is given.

Properties

Key

The key that is pressed.

C#
public Key Key { get; }

Property Value

Key

Modifiers

The keys of which one must be held (both Alt keys, both Control keys…).

C#
public IReadOnlyList<Key> Modifiers { get; }

Property Value

IReadOnlyList<Key>

Methods

<Clone>$()

C#
public KeyChord <Clone>$()

Returns

KeyChord

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(KeyChord?)

C#
public bool Equals(KeyChord? other)

Parameters

other KeyChord?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(KeyChord?, KeyChord?)

C#
public static bool operator ==(KeyChord? left, KeyChord? right)

Parameters

left KeyChord?

right KeyChord?

Returns

bool

operator !=(KeyChord?, KeyChord?)

C#
public static bool operator !=(KeyChord? left, KeyChord? right)

Parameters

left KeyChord?

right KeyChord?

Returns

bool