Table of Contents

Class KeyGesture

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

Key and Modifier combination. Can be set on properties of KeyBinding.

[TypeConverter(typeof(KeyGestureConverter))]
[ValueSerializer(typeof(KeyGestureValueSerializer))]
public class KeyGesture : InputGesture
Inheritance
KeyGesture

Constructors

KeyGesture(Key)

Creates KeyGesture instance with key value.

KeyGesture(Key, ModifierKeys)

Creates KeyGesture instance with key and key modifiers values.

KeyGesture(Key, ModifierKeys, bool)

Internal constructor used by KeyBinding to avoid key and modifier validation This allows setting KeyBinding.Key and KeyBinding.Modifiers without regard to order.

KeyGesture(Key, ModifierKeys, string)

Creates KeyGesture instance with key, key modifiers and display string values.

Properties

DisplayString

Gets display string for the end user.

Key

Gets key asociated with this KeyGesture.

Modifiers

Gets key modifiers asociated with this KeyGesture (Alt, Control, Shift, etc.)

Methods

GetDisplayStringForCulture(CultureInfo)

Returns a string that can be used to display the KeyGesture. If the DisplayString was set by the constructor, it is returned. Otherwise a suitable string is created from the Key and Modifiers, with any conversions being governed by the given CultureInfo.

Operators

implicit operator KeyGesture(string)

Implicit operator convertion from the string to the KeyGesture.