Table of Contents

Interface IKeybindManager

Namespace
Whim
Assembly
Whim.dll
IKeybindManager is responsible for managing all the keybinds for Whim.
public interface IKeybindManager

Properties

UnifyKeyModifiers

Whether to treat key modifiers like `LWin` and `RWin` as the same. For key modifiers which have a left and right variant, this will treat them as the same. Defaults to true.
bool UnifyKeyModifiers { get; set; }

Property Value

bool

Remarks

When this is set to true, all of the existing keybinds will be re-added in a unified form. All new keybinds will also be unified.

Methods

Clear()

Clears/removes all keybinds.
void Clear()

GetCommands(IKeybind)

Gets all the commands bound to the given keybind.
ICommand[] GetCommands(IKeybind keybind)

Parameters

keybind IKeybind
The keybind to get the commands for.

Returns

ICommand[]
An array of commands bound to the given keybind.

Remove(string)

Removes a keybind.
bool Remove(string commandId)

Parameters

commandId string
The identifier of the command to remove the keybind from.

Returns

bool
true if the keybind was removed; otherwise, false.

SetKeybind(string, IKeybind)

Sets a keybind. If a keybind already exists for the given command, it will be overwritten.
void SetKeybind(string commandId, IKeybind keybind)

Parameters

commandId string
The identifier of the command to bind to.
keybind IKeybind
The keybind to set.

Remarks

Keybinds can have multiple commands bound to them. Commands can have a single keybind.

TryGetKeybind(string)

Gets the keybind for the given command.
IKeybind? TryGetKeybind(string commandId)

Parameters

commandId string
The identifier of the command to get the keybind for.

Returns

IKeybind
The keybind for the given command.