Class
KeyFactory

A factory used to create key instances.

Definition

Namespace:Telerik.WinControls.VirtualKeyboard

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class KeyFactory : IKeyFactory

Inheritance: objectKeyFactory

Implements: IKeyFactory

Constructors

KeyFactory()

Declaration

cs-api-definition
public KeyFactory()

Methods

CreateKey(int, KeyType, double, double, bool, bool)

Creates a key that sends a virtual key code when pressed.

Declaration

cs-api-definition
public virtual IKey CreateKey(int keyCode, KeyType keyType = KeyType.Normal, double width = 1, double height = 1, bool sharpStyle = false, bool showSecondaryText = false)

Parameters

keyCode

int

The virtual key code.

keyType

KeyType

The type of the key.

width

double

The logical width of key.

height

double

The logical height of key.

sharpStyle

bool

Indicates whether the key has more noticeable(sharp) style.

showSecondaryText

bool

Indicates whether to show the secondary text element.

Returns

IKey

The created IKey instance.

Implements IKeyFactory.CreateKey(int, KeyType, double, double, bool, bool)

CreateNumpadKey(int, string, int, string, double, double, bool, Font, Font)

Creates a numpad key, which has two different virtual key codes to be sent depending on the state of Numlock key.

Declaration

cs-api-definition
public virtual IKey CreateNumpadKey(int numLockActiveCode, string activeKeyText, int alternateKeyCode, string alternateKeyText, double width = 1, double height = 1, bool sharpStyle = false, Font activeKeyFont = null, Font alternateKeyFont = null)

Parameters

numLockActiveCode

int

The virtual key code of active state.

activeKeyText

string

The text in active state.

alternateKeyCode

int

The virtual key code in alternate mode.

alternateKeyText

string

The text in alternate state.

width

double

The logical width of key.

height

double

The logical height of key.

sharpStyle

bool

Indicates whether the key has more noticeable(sharp) style.

activeKeyFont

Font

The font specified to the key element in active state.

alternateKeyFont

Font

The font specified to the key element in alternate state.

Returns

IKey

The created IKey instance.

Implements IKeyFactory.CreateNumpadKey(int, string, int, string, double, double, bool, Font, Font)

CreateSpecialKey(int, string, KeyType, double, double, bool, Font)

Creates a special key that sends a virtual key code when pressed and displays a text.

Declaration

cs-api-definition
public virtual IKey CreateSpecialKey(int keyCode, string displayText, KeyType keyType = KeyType.Normal, double width = 1, double height = 1, bool sharpStyle = false, Font font = null)

Parameters

keyCode

int

The virtual key code.

displayText

string

The display text.

keyType

KeyType

The type of the key.

width

double

The logical width of key.

height

double

The logical height of key.

sharpStyle

bool

Indicates whether the key has more noticeable(sharp) style.

font

Font

The font specified to the key element.

Returns

IKey

The created IKey instance.

Implements IKeyFactory.CreateSpecialKey(int, string, KeyType, double, double, bool, Font)