This document outlines “How to” tutorial and can give FPS Virtual Keyboard users a chance to get familiar with component within approximately 10 minutes.

To get started with it you can have Visual Studio 2012 and FPS Virtual Keyboard for WPF installed.

Create Default Keyboard

Here is a basic usage example, considering using Visual Studio 2012.

Default Keyboard

Create WPF Application; name it TouchKeyboardTest or whatever name you like. FPS Virtual Keyboard for WPF is built with .NET 4.5 so we choose .NET Framework 4.5

Now Add References for FPS.VirtualKeyboard.dll and FPS.Shared.dll. FPS.Shared.dll usage will be explained in next Chapter.

Apply xmlns namespace inside Window.xaml definition to get the component recognized:

xmlns:fps="clr­ namespace:FPS.VirtualKeyboard;assembly=FPS.VirtualKeyboard "

Now appropriate control can be found, just type inside Grid:


As a result of those 3 simple actions you will see VirtualKeyboard component shown on the Window in design time. Now press F5 and voila you have keyboard working inside the window.

keyboard windows

Using Predefined Theme

FPS.Shared Library contains a number of predefined themes for most of FPS Components built for WPF. If you put in code­behind the following line, Blue theme will be applied to VirtualKeyboard component automatically:



Press F5 and you will see expected window.

virtual keyboard example WPF

Any installed language supported.

Just imagine that you need to use your native language or you have an application to support some specific keyboard layout (German, Russian, and Chinese, whatever).

FPS Virtual Keyboard for WPF supports default generated layout, that works if no custom layout is found in Layouts folder where FPS.VirtualKeyboard.dll file is located. Switching current system language at runtime gives VirtualKeyboard component command to react. It can be done also by using special button:

virtual keyboard for WPF - German language default layout

German language default layout

Russian language default layout keyboard WPF

Russian language default layout

Note: Only QUERTY layouts are generated, as such languages as French uses different layout (AZERTY) it should be modified by using FPS.KeyboardCreator tool.


Using of Keyboard Creator

FPS Virtual Keyboard is supplied with a handy tool that can be used to create custom layout. You can run it from Start Menu ­ > All Programs ­ > FPS Components ­ > FPS.Virtual Keyboard for WPF ­ > FPS.VirtualKeyboard Creator

It is very simple to use and you can get auto­generated layout within 2 clicks, see screenshot below:

Using of Keyboard Creator

So just choose language and press Generate Default layout (or Extended). The result will be default QUERTY layout for selected language.

However many customers need to edit layout, i.e. remove not needed keys, move and resize buttons. By selecting button you can type character and if Upper or Lower case will be visible, as it needs sometimes in touchscreen applications.

Current functions are: Zoom, Copy, Paste, Delete, Multi selection, Drag drop of button from top toolbar, and right side functions for setting up every button’s properties.

You can also execute Layout ­ > Run Test command in main menu, which runs currently designed layout in test window right how it will be at runtime.

Generally with FPS.Keyboard Creator user can setup character or content (if user wants to override text), repetition used to give number of times button will react, for example common is “www.” Alt, Shift, Control lock is used to show value as default, for example ALT + “2” will return “@” to target text field.

Custom Theme

This document will not cover all aspects of writing custom styles in WPF. Along with FPS.VirtualKeyboard for WPF a sample that covers it is supplied.

Please check: FPS.VirtualKeyboard.Samples.CS.VS2012.sln that can be found in Windows Start Menu. Inside the sample there is CustomVirtualKeyboardStyle.xaml contained, which includes custom style definition for VirtualKeyboard. After the style is defined, you just need to apply it to keyboard component by following lines:

ResourceDictionary resources = new ResourceDictionary();
resources.Source = new Uri( "/FPS.VirtualKeyboard.Samples.Styles;component/CustomVirtualKeyboardStyle.xaml ", UriKind.Relative); 
this.Resources.MergedDictionaries.Add(resources); virtualKeyboard.ForceUpdateLayout(); 

ResourceDictionary resources = new ResourceDictionary();
resources.Source = new Uri( "/FPS.VirtualKeyboard.Samples.Styles;component/CustomVirtualKeyboardStyle.xaml ", UriKind.Relative); 
this.Resources.MergedDictionaries.Add(resources); virtualKeyboard.ForceUpdateLayout(); 

ResourceDictionary resources = new ResourceDictionary();resources.Source = new Uri( "/FPS.VirtualKeyboard.Samples.Styles;component/CustomVirtualKeyboardStyle.xaml ", UriKind.Relative); this.Resources.MergedDictionaries.Add(resources); virtualKeyboard.ForceUpdateLayout(); 

Below is actually custom style and layout for VirtualKeyboard component. This is from our samples, so you can find style and layout source in a place where component is installed.

custom theme virtual keyboard

64 bits support(Updated)

FPS Virtual Keyboard now works under x64 and x86, so we don’t target our build to any specific platform(CPU).

IsStandalone option

Such option is quite useful to have keyboard component to be used inside application as UserControl (IsStandalone = false) or behave exactly as Windows On­screen Keyboard tool, that works with any window that is currently in focus. Follow the example that is supplied with FPS Virtual Keyboard for WPF installation to get it working if you need this feature.

CanUnLockSpecialKey property should be used if you would like to not store pressed state of some special keys. This feature useful especially for Shift, Alt, Ctrl. Setting this property to true will unlock special key else special key will be pressed till you press it again

Template Layout property

It happens that users need to have same layout for different options so not need to edit all layouts per every language, even if key can work different for every language we give such possibility. In our sample code you can find how template layout is being used. Just a line of code in general:

virtualKeyboard.TemplateLayout= FPS.VirtualKeyboard.KeyboardLayout.Create(this.GetType().Assembly.GetManifestR



Licensing of FPS Components

A Knowledge Base topic covers licensing of any FPS Components for WPF, but the example code covers FPS Virtual Keyboard for WPF: