We have released version 5.3 of WPF Virtual Keyboard control. It contains the following new features and improvements:
Automatic popup and focus trackingThe VirtualKeyboard control now provides declarative virtual keyboard auto-show capabilities for WPF applications via attached dependency properties. Setting AutoShow="True" on a window or container enables the keyboard to automatically pop up when an editable control receives focus and dismiss when focus moves away:
- AutoShow - enables or disables automatic popup display for the target input (or for all child inputs when set on the parent Window or container).
- LayoutMode - specifies the keyboard layout (Default, Extended, Compact, Numeric3x4, or Numeric4x4) associated with the focused control. When defined at the window level, it provides the default layout for all fields; setting it on an individual control overrides the window default.
- PopupPlacement - defines the popup position relative to the focused control (PlacementMode.Bottom, Top, Left, Right, etc).
- CustomLayout - assigns a custom KeyboardLayout template to specific fields.
The popup uses a native non-activating window style (WS_EX_NOACTIVATE), ensuring that interaction with the virtual keyboard never steals keyboard focus from the active text box. When a PasswordBox receives focus, the keyboard automatically activates PasswordMode to conceal keypresses.
<Window
xmlns:vk="http://mindfusion.eu/keyboard/wpf"
vk:VirtualKeyboard.AutoShow="True"
vk:VirtualKeyboard.LayoutMode="Compact">
<StackPanel>
<!-- Inherits window-level default 'Compact' layout -->
<TextBox x:Name="txtFirstName" />
<!-- Overrides to 3x4 numeric keypad (0-9, Clear, Backspace) -->
<TextBox x:Name="txtUserID" vk:VirtualKeyboard.LayoutMode="Numeric3x4" />
<!-- Overrides to 4x4 numeric keypad (0-9, ., -, Clear, Backspace, Tab, Enter) -->
<TextBox x:Name="txtPhone" vk:VirtualKeyboard.LayoutMode="Numeric4x4" />
<!-- Automatically enables password masking -->
<PasswordBox x:Name="txtPassword" />
</StackPanel>
</Window>
New standard layoutsThree new built-in keyboard layouts have been added to the KeyboardMode enumeration and can be activated via the Mode property or retrieved as reusable KeyboardLayout templates:
- Compact - a streamlined layout without function keys (F1-F12) or redundant modifiers, ideal for mobile, touch, and compact popup windows.
- Numeric3x4 - a 3x4 telephone-style numeric keypad with 0-9 digits, Backspace, and Clear (C).
- Numeric4x4 - a 4x4 numeric keypad including 0-9, decimal point, minus sign, Backspace, Clear, Tab, and Enter.
// Select a layout mode directly or retrieve preconfigured layout objects
virtualKeyboard.Mode = KeyboardMode.Compact;
// Or use static factory methods for LayoutRing or TemplateLayout
var layout = KeyboardLayout.CompactLayout();
...
Miscellaneous- Added ClearKey class and static Clear property to clear the contents of currently focused input controls.
- Automatic password detection: the auto-show popup automatically enables PasswordMode when the target field is a password box.
The latest version can be downloaded here, or from the
clients area on our site:
https://mindfusion.dev/KeyboardWpf.zipUpdated assemblies are also available as
MindFusion.Keyboard.Wpf NuGet package.
Enjoy!