Click here to Skip to main content
13,049,814 members (75,344 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


5 bookmarked
Posted 12 Jun 2013

Combine physical keyboard with on-screen keyboard

, 12 Jun 2013
Rate this:
Please Sign up or sign in to vote.
Create your own keyboards, keypads/ virtual buttons on top of other windows; filter unwanted input.

On-Screen Keyboard


Many developers argue that analysis of user inputs is not an easy task and some of the existing software are inherently safer just because of bad inputs. I have a need to make an on-screen keyboard with standard features for my hydrological library (this library basically is a bunch of functions for spatial and temporal computation which has been developed in Vrije University of Brussels). The article looks at a small part of my work starting from zero in programming to making a virtual keyboard. The advantage of this keyboard in an international environment like Brussels is that you may avoid wrong characters. In addition these simple features make life much easier.


Sometimes you prefer to use a virtual keyboard instead of relying on the physical keyboard. You may use On-Screen Keyboard as an optional way to input data or you can mix the entered data from physical and virtual keyboards. This On-Screen Keyboard is designed to display a visual of all the standard keys. The current version of the on-screen keyboard accepts input from three kinds of controls including combobox, textbox, richtextbox, but you can easily extend it for other usages.

Using the code

As you can see in the provided example, there is just one form that is the heart of this On-Screen keyboard. The only thing that must be done in your own application is implementing the type of input controls, like this:

Keybord VirtualKeyoard = new Keybord();
VirtualKeyoard.PARENT = this;
//define bounded control here
VirtualKeyoard.SetControl = InputrichText;
int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
int screenWidth = Screen.PrimaryScreen.WorkingArea.Width;
Point parentPoint = this.Location; int parentHeight = this.Height;
int parentWidth = this.Width;
int resultX; int resultY;
resultY = parentPoint.Y + (this.Height);
resultX = parentPoint.X + 30;
VirtualKeyoard.Location = new Point(resultX, resultY);
//if you want to force //
VirtualKeyoard.ShowDialog(this); VirtualKeyoard.Show(this);

Points of Interest

I could not find time to test the keyboard in practice but the initial test was quite OK.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Student VUB:Vrije Universiteit Brussel
Belgium Belgium
My name is Khodayar Abdollahi, I am a PhD student in Vrije University of Brussels. My research is focused on hydro-informatics.

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 12 Jun 2013
Article Copyright 2013 by kabdolla
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid