🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1264

Re: Reading ALT keys with bioskey in TC++?

#1264
From: Mark Harrison
Date: Thu, 03 Sep 1992 20:30
40 lines
2478 bytes
In article <rvs.41@parst1.UUCP> rvs@parst1.UUCP (Roelof van Suilichem) writes:
>In article <1992Aug25.184207.7825@lclark.edu> harrison@sun.lclark.edu (Mark Harrison) writes:
>
>>Hi.  I am reading ALT+<key> from the keyboard with bioskey (in TC++ 3.0.)
>>But that gives me values that map to the physical layout of the keyboard. 
>>Is there an easy way to translate this value into one that will tell me
>>the Ascii code of the key?  For instance, how do I transform 0x3100
>>(ALT+N) to get the ascii code of N?  Will I need to write a function that
>>will do this for all the ALT values I want to check for?  If so, then no
>>problem.  I just don't want to reinvent any wheels.
>
>OK, here is my invented wheel.  Might save you some typing.
>Use as you want, at your own risk.  If you are going to use it
>just Email me so I get some satisfaction of knowing that somebody
>is actually using it.
>

I tried e-mail, but it bounced.  So I'll post in case anyone else is
interested.

Thanks for replying.  I havn't look at your code real well yet, but it
looks like the way I ended up doing it.  I got tired of waiting, and did
it myself.  I looked the code up in an array of ALT Keys.  It was sorted
alphabetically.  Then I returned the index of the array + 65.  So Alt-D
would be the fourth value in the array.  Index of the array is 3.
3 + 65 = 68.  68 = 'D'.  Basically the same type of thing.  Maybe if the
need arises to expand my routine, I can combine ours.  But for now I just
need to know the ASCII letter pushed with the ALT key.  CTRL keys are
handled just fine.

Thanks again.  Yours is only the second reply I have gotten in two weeks,
and the first guy told me to use getch().

Mark

-- 
=============================================================================
Mark Harrison           |  "We are the Priests, of the Temples of Syrinx
harrison@sun.lclark.edu |   Our great computers fill the hallowed halls."
              -- Me     |                                    -- Rush
Technical Details
Message-ID: <1992Sep3.203001.21161@lclark.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!ogicse!lclark!harrison
References: <1992Aug25.184207.7825@lclark.edu> <rvs.41@parst1.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!ogicse!lclark!harrison
From: harrison@lclark.edu (Mark Harrison)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Reading ALT keys with bioskey in TC++?
Message-ID: <1992Sep3.203001.21161@lclark.edu>
Date: 3 Sep 92 20:30:01 GMT
Article-I.D.: lclark.1992Sep3.203001.21161
References: <1992Aug25.184207.7825@lclark.edu> <rvs.41@parst1.UUCP>
Organization: Lewis & Clark College, Portland OR
Lines: 40