home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 9031 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  2.4 KB

  1. Path: sparky!uunet!wupost!uwm.edu!ogicse!lclark!harrison
  2. From: harrison@lclark.edu (Mark Harrison)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Reading ALT keys with bioskey in TC++?
  5. Message-ID: <1992Sep3.203001.21161@lclark.edu>
  6. Date: 3 Sep 92 20:30:01 GMT
  7. Article-I.D.: lclark.1992Sep3.203001.21161
  8. References: <1992Aug25.184207.7825@lclark.edu> <rvs.41@parst1.UUCP>
  9. Organization: Lewis & Clark College, Portland OR
  10. Lines: 40
  11.  
  12. In article <rvs.41@parst1.UUCP> rvs@parst1.UUCP (Roelof van Suilichem) writes:
  13. >In article <1992Aug25.184207.7825@lclark.edu> harrison@sun.lclark.edu (Mark Harrison) writes:
  14. >
  15. >>Hi.  I am reading ALT+<key> from the keyboard with bioskey (in TC++ 3.0.)
  16. >>But that gives me values that map to the physical layout of the keyboard. 
  17. >>Is there an easy way to translate this value into one that will tell me
  18. >>the Ascii code of the key?  For instance, how do I transform 0x3100
  19. >>(ALT+N) to get the ascii code of N?  Will I need to write a function that
  20. >>will do this for all the ALT values I want to check for?  If so, then no
  21. >>problem.  I just don't want to reinvent any wheels.
  22. >
  23. >OK, here is my invented wheel.  Might save you some typing.
  24. >Use as you want, at your own risk.  If you are going to use it
  25. >just Email me so I get some satisfaction of knowing that somebody
  26. >is actually using it.
  27. >
  28.  
  29. I tried e-mail, but it bounced.  So I'll post in case anyone else is
  30. interested.
  31.  
  32. Thanks for replying.  I havn't look at your code real well yet, but it
  33. looks like the way I ended up doing it.  I got tired of waiting, and did
  34. it myself.  I looked the code up in an array of ALT Keys.  It was sorted
  35. alphabetically.  Then I returned the index of the array + 65.  So Alt-D
  36. would be the fourth value in the array.  Index of the array is 3.
  37. 3 + 65 = 68.  68 = 'D'.  Basically the same type of thing.  Maybe if the
  38. need arises to expand my routine, I can combine ours.  But for now I just
  39. need to know the ASCII letter pushed with the ALT key.  CTRL keys are
  40. handled just fine.
  41.  
  42. Thanks again.  Yours is only the second reply I have gotten in two weeks,
  43. and the first guy told me to use getch().
  44.  
  45. Mark
  46.  
  47. -- 
  48. =============================================================================
  49. Mark Harrison           |  "We are the Priests, of the Temples of Syrinx
  50. harrison@sun.lclark.edu |   Our great computers fill the hallowed halls."
  51.               -- Me     |                                    -- Rush
  52.