Click here to Skip to main content
14,579,459 members

Onscreen Keyboard

Rate this:
4.71 (34 votes)
Please Sign up or sign in to vote.
4.71 (34 votes)
21 Mar 2000
An onscreen keyboard for pen computing and touchscreens
  • Download source files - 143 Kb

    Sample Image - OnscreenKeyboard.gif

    I needed a simple onscreen keyboard to interface with a touch / pen based computer that I bought through an online auction. Although Microsoft supplies one with its Pen Extensions 2.0 it only works win Win95 and I wanted to use NT.

    All of the available onscreen keyboards I found were either too expensive, or they were only designed to operate with 3.1 and 9x so (of course) I decided to see if I could make one. Along the way I learned a little about how the keyboard is handled, and the thread keyboard maps.

    Included with this article is a working, but simple, onscreen keyboard. I submitted it mostly as an example of the methods:

    • AttachThreadInput
    • keybd_event
    • VkKeyScan
    • GetKeyState

    This program has one nasty limitation, and that is that it "flashes" since it does not prevent the changing of focus to itself when clicked, and then back to the target window when the keystroke is generated. If someone wants to tackle that one please feel free ;-)

  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    Randy More
    United States United States
    No Biography provided

    Comments and Discussions

    Questionhi Pin
    Member 1364080424-Jan-18 1:29
    MemberMember 1364080424-Jan-18 1:29 
    Generalajka454 Pin
    ajka45426-Jan-14 22:00
    professionalajka45426-Jan-14 22:00 
    Questioncomments Pin
    graceman201217-Aug-12 19:28
    Membergraceman201217-Aug-12 19:28 
    Questionsendkey is sometimes failing Pin
    Member 815507614-Aug-12 2:35
    MemberMember 815507614-Aug-12 2:35 
    QuestionI need help to port web based G7 onscreen-keypad to Windows Native application. Pin
    Member 815507611-Aug-12 1:16
    MemberMember 815507611-Aug-12 1:16 
    QuestionHealth Pin
    kate198321-Feb-12 1:48
    Memberkate198321-Feb-12 1:48 
    QuestionGood sample Pin
    BaoSaka27-Jun-11 5:45
    MemberBaoSaka27-Jun-11 5:45 
    GeneralMy vote of 5 Pin
    Chandrasekharan P21-Jun-11 20:01
    MemberChandrasekharan P21-Jun-11 20:01 
    Generalcan't run the source code manually Pin
    noordiana21-Oct-10 4:38
    Membernoordiana21-Oct-10 4:38 
    GeneralOn Screen Keyboard - Korean Pin
    Member 31486272-Mar-10 8:55
    MemberMember 31486272-Mar-10 8:55 
    Questiononscreen keyboard Pin
    saranshs24-Oct-09 5:53
    Membersaranshs24-Oct-09 5:53 
    QuestionChording-like Keyboard like Onscreen Keyboard Pin
    mike spano5-Mar-09 10:33
    Membermike spano5-Mar-09 10:33 
    Generaldisabled keyboard Pin
    phantoms3316-Oct-08 15:42
    Memberphantoms3316-Oct-08 15:42 
    QuestionFor Vb.NET 2005 .. 2.0 Pin
    ferozasi25-Mar-08 4:53
    professionalferozasi25-Mar-08 4:53 
    GeneralTo stop flashing Pin
    Vibes8-May-07 18:04
    MemberVibes8-May-07 18:04 
    GeneralRe: To stop flashing Pin
    cxcui5-Jun-07 9:28
    Membercxcui5-Jun-07 9:28 
    GeneralRe: To stop flashing Pin
    Member 364201630-Jun-09 17:53
    MemberMember 364201630-Jun-09 17:53 
    Questionvirtual keyboard using java Pin
    Member 37203626-Mar-07 6:47
    MemberMember 37203626-Mar-07 6:47 
    AnswerRe: virtual keyboard using java Pin
    akash214713-Jul-10 2:41
    Memberakash214713-Jul-10 2:41 
    QuestionDaniel Pin
    otaku191-Feb-07 22:56
    Memberotaku191-Feb-07 22:56 
    QuestionI have a problem with the address bar Pin
    arrodenas4-Nov-06 10:35
    Memberarrodenas4-Nov-06 10:35 
    AnswerRe: I have a problem with the address bar Pin
    storein19-Dec-06 23:57
    Memberstorein19-Dec-06 23:57 
    GeneralRe: I have a problem with the address bar Pin
    arrodenas2-Jan-07 8:33
    Memberarrodenas2-Jan-07 8:33 
    GeneralFixed the ESC key Pin
    cfo5ter5-Sep-06 12:31
    Membercfo5ter5-Sep-06 12:31 
    GeneralRe: Fixed the ESC key Pin
    storein17-Dec-06 14:58
    Memberstorein17-Dec-06 14:58 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Posted 21 Mar 2000


    101 bookmarked