Table of Contents

Class VirtualKeyExtensions

Namespace
Whim
Assembly
Whim.dll
Extension methods for VIRTUAL_KEY.
public static class VirtualKeyExtensions
Inheritance
VirtualKeyExtensions
Inherited Members

Methods

GetKeyString(VIRTUAL_KEY, bool)

Return the VIRTUAL_KEY as a string.
public static string GetKeyString(this VIRTUAL_KEY key, bool unifyKeyModifiers = false)

Parameters

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

Returns

string

SortModifiers(IEnumerable<VIRTUAL_KEY>)

Sorts the key modifiers.
public static ImmutableArray<VIRTUAL_KEY> SortModifiers(IEnumerable<VIRTUAL_KEY> modifiers)

Parameters

modifiers IEnumerable<VIRTUAL_KEY>
The key modifiers to sort.

Returns

ImmutableArray<VIRTUAL_KEY>
The sorted key modifiers.

TryGetModifier(VIRTUAL_KEY, out KeyModifiers)

Tries to get the KeyModifiers from a VIRTUAL_KEY.
public static bool TryGetModifier(this VIRTUAL_KEY key, out KeyModifiers modifier)

Parameters

key VIRTUAL_KEY
The key to get the modifier from.
modifier KeyModifiers
The modifier, if successful.

Returns

bool
true if the key is a modifier; otherwise, false.

TryParseKey(string, out VIRTUAL_KEY)

Try to parse a key from a string.
public static bool TryParseKey(this string keyString, out VIRTUAL_KEY key)

Parameters

keyString string
The string to parse.
key VIRTUAL_KEY
The parsed key.

Returns

bool
true if the key was parsed successfully; otherwise, false.

Remarks

This method is case-insensitive.
See Also

TryParseKeyModifier(string, out VIRTUAL_KEY)

Tries to parse a key modifier from a string.
public static bool TryParseKeyModifier(this string modifier, out VIRTUAL_KEY keyModifier)

Parameters

modifier string
The string to parse. This is case-insensitive.
keyModifier VIRTUAL_KEY
The parsed key modifier, if successful.

Returns

bool
true if the parse was successful; otherwise, false.