Click here to Skip to main content
11,413,961 members (76,528 online)
Click here to Skip to main content

Onscreen Keyboard

, 21 Mar 2000
Rate this:
Please Sign up or sign in to vote.
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 Wink | ;-)

  • 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

    Share

    About the Author

    Randy More

    United States United States
    No Biography provided

    Comments and Discussions

     
    Generalajka454 Pin
    ajka454, 26-Jan-14 23:00
    professionalajka45426-Jan-14 23:00 
    Questioncomments Pin
    graceman2012, 17-Aug-12 20:28
    membergraceman201217-Aug-12 20:28 
    Questionsendkey is sometimes failing Pin
    Member 8155076, 14-Aug-12 3:35
    memberMember 815507614-Aug-12 3:35 
    QuestionI need help to port web based G7 onscreen-keypad to Windows Native application. [modified] Pin
    Member 8155076, 11-Aug-12 2:16
    memberMember 815507611-Aug-12 2:16 
    QuestionHealth Pin
    kate1983, 21-Feb-12 2:48
    memberkate198321-Feb-12 2:48 
    QuestionGood sample Pin
    BaoSaka, 27-Jun-11 6:45
    memberBaoSaka27-Jun-11 6:45 
    GeneralMy vote of 5 Pin
    Chandru080, 21-Jun-11 21:01
    memberChandru08021-Jun-11 21:01 
    Generalcan't run the source code manually Pin
    noordiana, 21-Oct-10 5:38
    membernoordiana21-Oct-10 5:38 
    GeneralOn Screen Keyboard - Korean Pin
    Member 3148627, 2-Mar-10 9:55
    memberMember 31486272-Mar-10 9:55 
    Questiononscreen keyboard Pin
    saranshs, 24-Oct-09 6:53
    membersaranshs24-Oct-09 6:53 
    QuestionChording-like Keyboard like Onscreen Keyboard Pin
    mike spano, 5-Mar-09 11:33
    membermike spano5-Mar-09 11:33 
    I am very interested in building an alternate keyboard single handed mouse/chording keyboard, with an onscreen keyboard. I envision a quarter circle in any corner of the svreen with a spinning dial controled by the chording buttons and 3-4 rows of letters/numbers/characters with other keys selecting which row to use. I can handle the device build, but how hard woukld it be to modify the C++ project provided here or is Java a better approach?

    Anyone interested in the coding aspect?

    Thanks Mike
    Generaldisabled keyboard Pin
    phantoms33, 16-Oct-08 16:42
    memberphantoms3316-Oct-08 16:42 
    QuestionFor Vb.NET 2005 .. 2.0 Pin
    ferozasi, 25-Mar-08 5:53
    memberferozasi25-Mar-08 5:53 
    GeneralTo stop flashing Pin
    Vibes, 8-May-07 19:04
    memberVibes8-May-07 19:04 
    GeneralRe: To stop flashing Pin
    cxcui, 5-Jun-07 10:28
    membercxcui5-Jun-07 10:28 
    GeneralRe: To stop flashing Pin
    Member 3642016, 30-Jun-09 18:53
    memberMember 364201630-Jun-09 18:53 
    Questionvirtual keyboard using java Pin
    Member #3720362, 6-Mar-07 7:47
    memberMember #37203626-Mar-07 7:47 
    AnswerRe: virtual keyboard using java Pin
    akash2147, 13-Jul-10 3:41
    memberakash214713-Jul-10 3:41 
    QuestionDaniel Pin
    otaku19, 1-Feb-07 23:56
    memberotaku191-Feb-07 23:56 
    QuestionI have a problem with the address bar Pin
    arrodenas, 4-Nov-06 11:35
    memberarrodenas4-Nov-06 11:35 
    AnswerRe: I have a problem with the address bar Pin
    storein, 20-Dec-06 0:57
    memberstorein20-Dec-06 0:57 
    GeneralRe: I have a problem with the address bar Pin
    arrodenas, 2-Jan-07 9:33
    memberarrodenas2-Jan-07 9:33 
    GeneralFixed the ESC key Pin
    cfo5ter, 5-Sep-06 13:31
    membercfo5ter5-Sep-06 13:31 
    GeneralRe: Fixed the ESC key Pin
    storein, 17-Dec-06 15:58
    memberstorein17-Dec-06 15:58 
    QuestionONSCREEN KEYBOARD Pin
    raeesa, 4-Sep-06 4:47
    memberraeesa4-Sep-06 4:47 
    GeneralRe: ONSCREEN KEYBOARD Pin
    brahmma, 9-May-07 8:55
    memberbrahmma9-May-07 8:55 
    QuestionCan we change initial size? Pin
    peterpecker, 10-Mar-06 6:43
    memberpeterpecker10-Mar-06 6:43 
    QuestionRe: Can we change initial size? Pin
    gidtitan, 21-Mar-07 11:06
    membergidtitan21-Mar-07 11:06 
    Generala better Onscreen Virtual keyboard Pin
    Ilanbm, 1-Mar-06 3:11
    memberIlanbm1-Mar-06 3:11 
    GeneralRe: a better Onscreen Virtual keyboard - Link Pin
    Ilanbm, 1-Mar-06 3:12
    memberIlanbm1-Mar-06 3:12 
    GeneralRe: a better Onscreen Virtual keyboard - Link Pin
    jmelgaard, 17-Jan-07 2:57
    memberjmelgaard17-Jan-07 2:57 
    GeneralTentative Enhancement Pin
    dickch, 20-Dec-05 14:19
    memberdickch20-Dec-05 14:19 
    QuestionRe: Tentative Enhancement Pin
    JYCiou, 5-Mar-06 15:20
    memberJYCiou5-Mar-06 15:20 
    QuestionRe: Tentative Enhancement Pin
    Homero De la Garza, 5-Aug-07 9:37
    memberHomero De la Garza5-Aug-07 9:37 
    GeneralRe: Tentative Enhancement Pin
    gidtitan, 21-Mar-07 11:07
    membergidtitan21-Mar-07 11:07 
    QuestionJapanese? Pin
    matsnas, 6-Dec-05 23:07
    membermatsnas6-Dec-05 23:07 
    GeneralTimer Pin
    simcon, 8-Jun-05 0:20
    susssimcon8-Jun-05 0:20 
    Generalexecute Pin
    Simon Potzkai, 30-May-05 0:58
    memberSimon Potzkai30-May-05 0:58 
    GeneralKill keyboard from another app Pin
    barnes1022@yahoo.com, 16-Feb-05 12:10
    memberbarnes1022@yahoo.com16-Feb-05 12:10 
    GeneralRe: Kill keyboard from another app Pin
    Dirk Moshage, 21-Feb-05 7:26
    memberDirk Moshage21-Feb-05 7:26 
    GeneralRe: Kill keyboard from another app Pin
    jbarnes1022, 25-Feb-05 7:45
    memberjbarnes102225-Feb-05 7:45 
    GeneralUsing the Windows OSK Pin
    Alex Evans, 29-Jan-05 19:35
    memberAlex Evans29-Jan-05 19:35 
    GeneralRe: Using the Windows OSK Pin
    EjayBoy, 1-Aug-06 13:04
    memberEjayBoy1-Aug-06 13:04 
    GeneralRe: Using the Windows OSK Pin
    EjayBoy, 1-Aug-06 14:10
    memberEjayBoy1-Aug-06 14:10 
    GeneralDon't work on remote desktop logon window Pin
    yoslee, 20-Jan-05 22:11
    memberyoslee20-Jan-05 22:11 
    GeneralOnscreen Keyboard Internationalization Matter ... Pin
    Duranti Loris, 11-Jan-05 3:04
    sussDuranti Loris11-Jan-05 3:04 
    Generalabt OnScreen Keyboard Pin
    Tripura.K, 3-Dec-04 1:06
    memberTripura.K3-Dec-04 1:06 
    Generalabt OnScreen Keyboard Pin
    Anonymous, 2-Dec-04 23:31
    sussAnonymous2-Dec-04 23:31 
    GeneralCan't Compile Pin
    rajwsinder singh, 2-Dec-04 0:57
    memberrajwsinder singh2-Dec-04 0:57 
    GeneralRe: Can't Compile Pin
    EP70L-PGKDSG, 7-Dec-04 2:47
    memberEP70L-PGKDSG7-Dec-04 2:47 

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

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

    | Advertise | Privacy | Terms of Use | Mobile
    Web04 | 2.8.150427.2 | Last Updated 22 Mar 2000
    Article Copyright 2000 by Randy More
    Everything else Copyright © CodeProject, 1999-2015
    Layout: fixed | fluid