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;
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);
Points of Interest
I could not find time to test the keyboard in practice but the initial test was quite OK.