Table of Contents

Method TryParse

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

TryParse(string, out Key)

Converts the provided string to a new Key instance.

public static bool TryParse(string text, out Key key)

Parameters

text string

The text to analyze. Formats supported are "Ctrl+X", "Alt+X", "Shift+X", "Ctrl+Alt+X", "Ctrl+Shift+X", "Alt+Shift+X", "Ctrl+Alt+Shift+X", "X", and "120" (Unicode codepoint).

The separator can be any character, not just Separator (e.g. "Ctrl@Alt@X").

key Key

The parsed value.

Returns

bool

A boolean value indicating whether parsing was successful.