Keyboard Class

A virtual keyboard templated control.

Definition

Namespace: BeeMobile.VirtualKeyboard
Assembly: BeeMobile.VirtualKeyboard.AVA.NET6 (in BeeMobile.VirtualKeyboard.AVA.NET6.dll) Version: 11.0.0.2+aef809e856abb10e94d0b4c45f10d1805addc36e
C#
public class Keyboard : TemplatedControl
Inheritance
Object    AvaloniaObject    Animatable    StyledElement    Visual    Layoutable    Interactive    InputElement    Control    TemplatedControl    Keyboard

Remarks

The control was designed to be used as a singleton. It is declared once for the whole app and reused when needed.
The keyboard itself only provides functionality, for it to show something meaningful a KeyboardLayout has to be registered to it and requested to be shown.
To register a layout call RegisterLayoutT for each layout you would like to show later.

The keyboard provides several attached properties that make the process of showing the keyboard easier.
1. Start by choosing a Panel where the keyboard will place itself when asked to show itself. This Panel has to have the attached DockIdentifierProperty set to a value we will use later to specify that we want the keyboard to open here.
2. Choose a control that will open the keyboard when it receives focus.
3. Set the attached LayoutProperty to the name of the KeyboardLayout you would like to show.
4. Set the attached DockProperty to an existing DockIdentifierProperty where you would like the keyboard to open.
Now, when the control with the attached properties receives focus, the keyboard will place itself in the specified panel and will open the specified layout.

Once shown, the keyboard will aggregate virtual key presses from the KeyboardLayout, translate them and propagate them into the currently focused control.

Constructors

Keyboard Initializes a new instance of the Keyboard class.

Properties

CurrentLayout Returns the currently selected KeyboardLayout.
IsDebugInfoShown Used to turn on or off debug information.
RegisteredLayouts A readonly collection of the currently registered KeyboardLayouts. To modify this collection use the RegisterLayoutT or RemoveLayout(String) methods.
SendTextInputOn Determinates whether text is sent when a key is pressed or released.
ShowLayoutCommand The ShowLayout(String) method exposed as a ICommand.

Methods

BringFocusedControlIntoView Tries to bring the currently focused Control into view.
ContainsLayout Checks if we can find a specific KeyboardLayout inside the RegisteredLayouts.
FindLayout Looks for a specific KeyboardLayout inside the RegisteredLayouts.
GetDock Helper method for retrieving the attached DockProperty from a control.
GetDockIdentifier Helper method for retrieving the value of an attached DockIdentifierProperty from a Panel.
GetLayout Helper method for retrieving the attached LayoutProperty from a control.
HideKeyboard Hides the keyboard by removing it from the logical tree.
HideKeyboardAndUnfocus Hides the keyboard by removing it from the logical tree and unfocuses the element that caused the keyboard to show itself.
OnApplyTemplate Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.
(Overrides TemplatedControl.OnApplyTemplate(TemplateAppliedEventArgs))
OnFocusChanged The focus changed event is handled by inspecting the currently focused element's attached properties.
OnKeyPressed Handles the KeyPressedEvent. It propagates the information into the currently focused element.
OnKeyReleased Handles the KeyReleasedEvent. It propagates the information into the currently focused element.
RaiseSpecialKeyEvents Determines how the keyboard handles Keys where the SpecialKey property is set.
RegisterLayoutT Tries to register a new KeyboardLayout with the keyboard.
RemoveLayout Tries to remove a layout from RegisteredLayouts specified by its layoutName.
SetDock Helper method for setting the attached DockProperty on a control.
SetDockIdentifier Helper method for setting the DockIdentifierProperty on a panel.
SetLayout Helper method for setting the attached LayoutProperty on a control.
ShowKeyboard Shows the keyboard by placing it in the panels Children collection.
ShowLayout Looks for a layout that can be identified by the layoutName and shows it.
Unfocus Clears the focus if the keyboard is attached to the visual tree.
UpdateDebugTextBox Updates the debug information.

Fields

_activeKeyModifiers Keeps track of the currently pressed modifier keys.
_altBuffer Keeps track of how many alt buttons have been pressed.
_ctrlBuffer Keeps track of how many ctrl buttons have been pressed.
_currentLayout The underyling value of the CurrentLayout property.
_debugTextBlock A reference to the debug TextBlock that will show debug information if the IsDebugInfoShownProperty is set to true.
_registeredLayouts A list of all the KeyboardLayouts that the Keyboard is able to show.
_shiftBuffer Keeps track of how many shift buttons have been pressed.
_winBuffer Keeps track of how many win/meta buttons have been pressed.
CurrentLayoutProperty Returns the currently selected KeyboardLayout.
DockIdentifierProperty Set on a Panel to give it a unique identifier, the keyboard will use the identifier to differentiate it from other panels.
DockProperty Is used to identify the Panel where the Keyboard should place itself when the control that this property is attached to receives focus.
IsDebugInfoShownProperty Used to turn on or off debug information.
LayoutProperty Defines which KeyboardLayout the Keyboard should try to open when the control that this property is attached to recieves focus.
SendTextInputOnProperty Determinates whether text is sent when a key is pressed or released.

See Also