Table of Contents

Method GetShortcutText

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetShortcutText(bool, bool)

Retrieves the text representation of the shortcut key, optionally formatted using a template.

public virtual string? GetShortcutText(bool useTemplate, bool forUser = true)

Parameters

useTemplate bool

A value indicating whether to format the shortcut key using a predefined template. If true, the shortcut key is formatted using the template specified by ShortcutToolTipTemplate or a default template. If false, the raw string representation of the shortcut key is returned.

forUser bool

The forUser parameter determines whether the shortcut key is formatted for display to the user.

Returns

string

A string representing the shortcut key. If no shortcut key is available or the key is null, the method returns null.

Remarks

The method filters the shortcut key information based on the backend operating system before generating the text representation. If multiple keys are available, only the first key is used.