Click here to Skip to main content
Click here to Skip to main content

Tagged as

Combine Keyboard Inputs and Mouse to Improve Input Data

, 16 Jun 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Learn how to combine physical keyboard inputs and mouse to improve input data

Introduction

Many developers argue that analysis of user inputs is not an easy task and some of existing software’s 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 current article looks at a small part of my work starting from zero in programming to make 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.

Background

Sometimes, you prefer to use 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 entered data from physical and virtual keyboards. This On-Screen Keyboard is designed to display all the standard keys, virtually. Current version of On-Screen keyboard accepts input from 3 kinds of control including Combobox, textbox, richtextbox but you can easily extend it for other sort of 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 control 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 keyboard in practice, but the initial test was quite OK.

License

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

Share

About the Author

kabdolla
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.

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 16 Jun 2013
Article Copyright 2013 by kabdolla
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid