KeyFactory
A factory used to create key instances.
Definition
Namespace:Telerik.WinControls.VirtualKeyboard
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class KeyFactory : IKeyFactory
Inheritance: objectKeyFactory
Implements:
Constructors
public KeyFactory()
Methods
Creates a key that sends a virtual key code when pressed.
public virtual IKey CreateKey(int keyCode, KeyType keyType = KeyType.Normal, double width = 1, double height = 1, bool sharpStyle = false, bool showSecondaryText = false)
The virtual key code.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
sharpStyleboolIndicates whether the key has more noticeable(sharp) style.
showSecondaryTextboolIndicates whether to show the secondary text element.
Returns:The created IKey instance.
Implements:
Creates a numpad key, which has two different virtual key codes to be sent depending on the state of Numlock key.
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)
The virtual key code of active state.
activeKeyTextstringThe text in active state.
alternateKeyCodeintThe virtual key code in alternate mode.
alternateKeyTextstringThe text in alternate state.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
sharpStyleboolIndicates whether the key has more noticeable(sharp) style.
activeKeyFontFontThe font specified to the key element in active state.
alternateKeyFontFontThe font specified to the key element in alternate state.
Returns:The created IKey instance.
Implements:
Creates a special key that sends a virtual key code when pressed and displays a text.
public virtual IKey CreateSpecialKey(int keyCode, string displayText, KeyType keyType = KeyType.Normal, double width = 1, double height = 1, bool sharpStyle = false, Font font = null)
The virtual key code.
displayTextstringThe display text.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
sharpStyleboolIndicates whether the key has more noticeable(sharp) style.
fontFontThe font specified to the key element.
Returns:The created IKey instance.
Implements: