Class RadVirtualKeyboardElement
The main element in the RadVirtualKeyboard control. It hosts all elements, logic, properties. methods and events.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadVirtualKeyboardElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IImageElement, ITextPrimitive, ITextProvider, IUpdateKeysListener, IKeyboardLayoutUpdatedListener, IKeyPressedListener, IVirtualKeyboardKeyInputSender
Constructors
RadVirtualKeyboardElement()
Initializes a new instance of the RadVirtualKeyboardElement class.
Declaration
public RadVirtualKeyboardElement()
Properties
ClickSoundStream
Gets or sets the key press sound stream. Note that if you have not set the stream this property will return the default sound.
Declaration
public Stream ClickSoundStream { get; set; }
Property Value
System.IO.Stream
|
CurrentCulture
Gets or sets current culture for the RadVirtualKeyboardElement.
Declaration
public CultureInfo CurrentCulture { get; set; }
Property Value
System.Globalization.CultureInfo
|
IsAltActive
Gets a value indicating, whether the Alt key is in active state.
Declaration
public bool IsAltActive { get; }
Property Value
System.Boolean
|
IsAltGrActive
Gets a value indicating, whether the Alt Gr(right alt) key is in active state.
Declaration
public bool IsAltGrActive { get; }
Property Value
System.Boolean
|
IsCapsLockOn
Gets a value indicating whether the CapsLock key is on.
Declaration
public static bool IsCapsLockOn { get; }
Property Value
System.Boolean
|
IsControlActive
Gets a value indicating, whether the Control key is in active state.
Declaration
public bool IsControlActive { get; }
Property Value
System.Boolean
|
IsNumLockActive
Gets a value indicating, whether the NumLock key is in active state.
Declaration
public bool IsNumLockActive { get; }
Property Value
System.Boolean
|
Implements
IsNumLockOn
Gets a value indicating whether the NumLock key is on.
Declaration
public static bool IsNumLockOn { get; }
Property Value
System.Boolean
|
IsScrollLockOn
Gets a value indicating whether the ScrollLock key is on.
Declaration
public static bool IsScrollLockOn { get; }
Property Value
System.Boolean
|
IsShiftActive
Gets a value indicating, whether the Shift key is in active state.
Declaration
public bool IsShiftActive { get; }
Property Value
System.Boolean
|
Implements
IsWindowsKeyActive
Gets a value indicating, whether the Windows key is in active state.
Declaration
public bool IsWindowsKeyActive { get; }
Property Value
System.Boolean
|
KeyboardLayoutUpdatedListenersList
Gets the IList with objects to be notified when keyboard layout/language/culture is changed.
Declaration
public static IList<IKeyboardLayoutUpdatedListener> KeyboardLayoutUpdatedListenersList { get; }
Property Value
System.Collections.Generic.IList<IKeyboardLayoutUpdatedListener>
|
LanguageCheckTimer
Gets the language change System.Windows.Forms.Timer.
Declaration
public static Timer LanguageCheckTimer { get; }
Property Value
System.Windows.Forms.Timer
|
LayoutType
Gets or sets the keyboard layout type. Changing the value will automatically set the MainLayoutPanel property with a predefined value.
Declaration
public KeyboardLayoutType LayoutType { get; set; }
Property Value
KeyboardLayoutType
|
MainLayoutPanel
Gets or sets the VirtualKeyboardLayoutPanel, which is used to host and arrange VirtualKeyboardLayoutPanel and VirtualKeyboardLayout objects.
Declaration
public VirtualKeyboardLayoutPanel MainLayoutPanel { get; set; }
Property Value
VirtualKeyboardLayoutPanel
|
ModifierKeys
Gets the collection with currently active modifier keys.
Declaration
public List<int> ModifierKeys { get; }
Property Value
System.Collections.Generic.List<System.Int32>
|
ScaleFontOnResize
Gets or sets a value indicating, whether to scale the font when control size in changed.
Declaration
public bool ScaleFontOnResize { get; set; }
Property Value
System.Boolean
|
Implements
SynchronizeCultureWithSystem
Gets or sets a value indicating whether the RadVirtualKeyboardElement will track with the system for language changes and will be updated automatically.
Declaration
public bool SynchronizeCultureWithSystem { get; set; }
Property Value
System.Boolean
|
UpdateKeysListenersList
Gets the IList with objects to be notified when CapsLock, NumLock or ScrollLock are toggled.
Declaration
public static IList<IUpdateKeysListener> UpdateKeysListenersList { get; }
Property Value
System.Collections.Generic.IList<IUpdateKeysListener>
|
UseClickSound
Gets or sets a value indicating whether to play sound when a key is pressed.
Declaration
public bool UseClickSound { get; set; }
Property Value
System.Boolean
|
Methods
DisposeManagedResources()
Disposes all MANAGED resources - such as Bitmaps, GDI+ objects, etc.
Declaration
protected override void DisposeManagedResources()
Overrides
DoKeyDown(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void DoKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
DoKeyPress(KeyPressEventArgs)
The method is not relevant for this element.
Declaration
protected override void DoKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
Overrides
DoKeyUp(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void DoKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
GetLayoutPanelByLayoutType(KeyboardLayoutType)
Returns a VirtualKeyboardLayoutPanel instance with predefined keyboard layout based on the given KeyboardLayoutType parameter.
Declaration
protected virtual VirtualKeyboardLayoutPanel GetLayoutPanelByLayoutType(KeyboardLayoutType value)
Parameters
KeyboardLayoutType
value
The keyboard layout type. |
Returns
VirtualKeyboardLayoutPanel
The created VirtualKeyboardLayoutPanel. |
GetTextFromKeyInfo(KeyInfo)
Extracts the text by given KeyInfo object.
Declaration
public string GetTextFromKeyInfo(KeyInfo keyInfo)
Parameters
KeyInfo
keyInfo
The info object. |
Returns
System.String
Returns the symbol/text. |
Implements
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
OnKeyboardLayoutChanged(VirtualKeyboardLayoutChangedEventArgs)
Forces the KeyboardLayoutChanged event.
Declaration
protected virtual void OnKeyboardLayoutChanged(VirtualKeyboardLayoutChangedEventArgs e)
Parameters
VirtualKeyboardLayoutChangedEventArgs
e
The VirtualKeyboardLayoutChangedEventArgs holding the event data. |
OnKeyDown(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnKeyPress(KeyPressEventArgs)
The method is not relevant for this element.
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
Overrides
OnKeyPressed(Keys)
Notifies all listeners when a key on the active window is pressed.
Declaration
public void OnKeyPressed(Keys key)
Parameters
System.Windows.Forms.Keys
key
The pressed key. |
Implements
OnKeyUp(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnVirtualKeySending(VirtualKeyboardKeySendingEventArgs)
Forces the KeySending event.
Declaration
protected virtual void OnVirtualKeySending(VirtualKeyboardKeySendingEventArgs e)
Parameters
VirtualKeyboardKeySendingEventArgs
e
The VirtualKeyboardKeySendingEventArgs holding the event data. |
OnVirtualKeySent(VirtualKeyboardKeySentEventArgs)
Forces the KeySent event.
Declaration
protected virtual void OnVirtualKeySent(VirtualKeyboardKeySentEventArgs e)
Parameters
VirtualKeyboardKeySentEventArgs
e
The VirtualKeyboardKeySentEventArgs holding the event data. |
PlaySound()
RaiseKeyDown(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void RaiseKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
RaiseKeyPress(KeyPressEventArgs)
The method is not relevant for this element.
Declaration
protected override void RaiseKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
Overrides
RaiseKeyUp(KeyEventArgs)
The method is not relevant for this element.
Declaration
protected override void RaiseKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
Send(IKey, Char)
Sends a key by given char.
Declaration
public void Send(IKey sender, char symbol)
Parameters
IKey
sender
The sender IKey instance. |
System.Char
symbol
The char to be sent. |
Implements
Send(IKey, Int32)
Sends a key by given virtual key.
Declaration
public void Send(IKey sender, int virtualKey)
Parameters
IKey
sender
The sender IKey instance. |
System.Int32
virtualKey
The virtual key code to be sent. |
Implements
Send(IKey, String)
Sends a key by given text/string.
Declaration
public void Send(IKey sender, string text)
Parameters
IKey
sender
The sender IKey instance. |
System.String
text
The string to be sent. |
Implements
Send(IKey, Keys)
Sends a key by given System.Windows.Forms.Keys.
Declaration
public void Send(IKey sender, Keys key)
Parameters
IKey
sender
The sender IKey instance. |
System.Windows.Forms.Keys
key
The System.Windows.Forms.Keys to be sent. |
Implements
SendCore(IKey, KeySendContext, Nullable<Int32>, String)
Sends a message by given virtual key code or text/string.
Declaration
protected virtual void SendCore(IKey sender, KeySendContext context, int? virtualKey = default(int? ), string text = null)
Parameters
IKey
sender
The sender IKey instance. |
KeySendContext
context
The key context. |
System.Nullable<System.Int32>
virtualKey
The virtual key code. |
System.String
text
The text. |
UpdateKeyboardLayout(CultureInfo)
Raises the KeyboardLayoutChanged event and updates keys after a system layout change.
Declaration
public void UpdateKeyboardLayout(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
The new culture. |
Implements
UpdateKeys()
Updates all keys texts. Gets the all keys from all VirtualKeyboardLayout and VirtualKeyboardLayoutPanel children and generates and updates their KeyInfo properties.
Declaration
public void UpdateKeys()
Implements
UpdateKeysListeners()
Notifies all listeners when CapsLock, NumLock or ScrollLock are toggled.
Declaration
public static void UpdateKeysListeners()
UpdateModifierKeys(IKey)
Updates the state of modifier keys based on the current state of the RadVirtualKeyboardElement.
Declaration
protected virtual void UpdateModifierKeys(IKey key)
Parameters
IKey
key
The given key. |
Events
KeyboardLayoutChanged
An event that occurs when the culture(keyboard language) is changed.
Declaration
public event VirtualKeyboardLayoutChangedEventHandler KeyboardLayoutChanged
Event Type
VirtualKeyboardLayoutChangedEventHandler
|
KeyDown
The event is not relevant for this element.
Declaration
public event KeyEventHandler KeyDown
Event Type
System.Windows.Forms.KeyEventHandler
|
KeyPress
The event is not relevant for this element.
Declaration
public event KeyPressEventHandler KeyPress
Event Type
System.Windows.Forms.KeyPressEventHandler
|
KeySending
An event that occurs when a key is about to be sent. Cancellable.
Declaration
public event VirtualKeyboardKeySendingEventHandler KeySending
Event Type
VirtualKeyboardKeySendingEventHandler
|
KeySent
An event that occurs when a key is sent.
Declaration
public event VirtualKeyboardKeySentEventHandler KeySent
Event Type
VirtualKeyboardKeySentEventHandler
|
KeyUp
The event is not relevant for this element.
Declaration
public event KeyEventHandler KeyUp
Event Type
System.Windows.Forms.KeyEventHandler
|