Table of Contents

Struct Keybind

Namespace
Whim
Assembly
Whim.dll
public readonly struct Keybind : IKeybind, IEquatable<Keybind>
Implements
Inherited Members
Extension Methods

Constructors

Keybind(IEnumerable<VIRTUAL_KEY>, VIRTUAL_KEY)

Creates a new keybind.
public Keybind(IEnumerable<VIRTUAL_KEY> modifiers, VIRTUAL_KEY key)

Parameters

modifiers IEnumerable<VIRTUAL_KEY>
The modifiers for the keybind.
key VIRTUAL_KEY
The key for the keybind.

Keybind(KeyModifiers, VIRTUAL_KEY)

Creates a new keybind.
public Keybind(KeyModifiers modifiers, VIRTUAL_KEY key)

Parameters

modifiers KeyModifiers
The modifiers for the keybind.
key VIRTUAL_KEY
The key for the keybind.

Properties

Key

See https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
public VIRTUAL_KEY Key { get; }

Property Value

VIRTUAL_KEY

Modifiers

Modifiers like Alt, Ctrl, and Win.
public KeyModifiers Modifiers { get; }

Property Value

KeyModifiers

Mods

Modifiers like Alt, Ctrl, and Win.
public IReadOnlyList<VIRTUAL_KEY> Mods { get; }

Property Value

IReadOnlyList<VIRTUAL_KEY>

Methods

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.

Equals(Keybind)

Indicates whether the current object is equal to another object of the same type.
public bool Equals(Keybind other)

Parameters

other Keybind
An object to compare with this object.

Returns

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

FromString(string)

Tries to parse a keybind from a string.
public static IKeybind? FromString(string keybind)

Parameters

keybind string
The string to parse.

Returns

IKeybind
The parsed keybind, if successful; otherwise, null.

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.

ToString()

Returns the fully qualified type name of this instance.
public override string ToString()

Returns

string
The fully qualified type name.

ToString(bool)

Returns a string representation of the keybind.
public string ToString(bool unifyKeyModifiers)

Parameters

unifyKeyModifiers bool
Whether to treat key modifiers like `LWin` and `RWin` as the same. See UnifyKeyModifiers.

Returns

string

Operators

operator ==(Keybind, Keybind)

public static bool operator ==(Keybind left, Keybind right)

Parameters

left Keybind
right Keybind

Returns

bool

operator !=(Keybind, Keybind)

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

Parameters

left Keybind
right Keybind

Returns

bool