🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2
Article #614

Re: no-echo input

#614
From: Bruce Kitchin
Date: Fri, 25 May 1990 15:46
21 lines
1975 bytes
I've not done this so there is some risk that my idea wont work, but I think I
can point you in the right direction.  All keyboard input in Windows and PM
is sent in the form of WM_CHAR messages to the window that has the keyboard
focus.  Normally when you put up a child window (or a field in a dialog box)
that is used for text entry, the window procedure for the text entry window
receives the WM_CHAR messages, accumulates the text in a buffer and displays
the text in the window.  You could create a child window or subclass a child
in a dialog box so that you rather than the standard window procedure receives
the WM_CHAR messages.  If you're not echoing because some access codeor
pass word is being entered, you might echo * or . for each character received
so that the user gets some feedback without compromising the password.
While Charles Petzold's book Programming Windows discussed keyboard input, it
does not have any examples that come close to what you are asking for.  In his
book Programming the OS/2 Presentation Manager, he covers the keyboard in
chapter 8 (Tapping the Keyboard).  There is one example, TypeAway.C, which
processes keyboard input in a window procedure.  Much of that code is unneeded
in what you want since it is concerned with displaying the characters.  The
example Organ.C may give a clearer picture of how to get keyboard input
character by character (the only way to avoid echo that I know of) even if
what he does when processing the keystroke is unrelated to your need, you
can probably figure out what you need.  Good luck.
Technical Details
Message-ID: <9660003@hpavla.AVO.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpcc01!hpcuhb!hpda!hpwala!hpavla!kitchin
References: <102@bohra.cpg.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpcc01!hpcuhb!hpda!hpwala!hpavla!kitchin
From: kitchin@hpavla.AVO.HP.COM (Bruce Kitchin)
Newsgroups: comp.os.os2
Subject: Re: no-echo input
Message-ID: <9660003@hpavla.AVO.HP.COM>
Date: 25 May 90 15:46:35 GMT
References: <102@bohra.cpg.oz>
Organization: Hewlett-Packard Avondale Division
Lines: 21