home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10048 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.7 KB  |  48 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!usenet-feed.cc.umr.edu!mcs213f.cs.umr.edu!dminer
  3. From: dminer@mcs213f.cs.umr.edu (Dan Miner)
  4. Subject: Quest for standard keyboard layouts.
  5. Date: Mon, 7 Sep 1992 05:29:55 GMT
  6. Nntp-Posting-Host: mcs213f.cs.umr.edu
  7. Organization: University of Missouri - Rolla
  8. Sender: cnews@umr.edu (UMR Usenet News Post)
  9. Message-ID: <1992Sep7.052955.29532@umr.edu>
  10. Lines: 36
  11.  
  12.     I'm taking a crack at a word processing program.  (Anyone,
  13. familiar with qedit?  :)  I'm using curses.  Here is the setup.
  14.  
  15. stdin: modified by ioctl(s) to quit processing STOP/START.
  16. curses: noecho, nonl, raw.
  17.     (I want FULL raw mode which is interesting to obtain.)
  18.  
  19.     Now, I'm using getch() (from curses) to get a char.
  20. I want to use cursor keys.  I get a sequence of chars for them.
  21. ESC[A    for up arrow
  22. ESC[B    for down arrow
  23. etc...
  24.  
  25.     I wrote a little routine to look for this.  
  26. descript:
  27.     watches for ESC
  28.     once found, count the # of '[' chars
  29.     store last unique char
  30.  
  31.     Now, I want to use the escape key but with this routine I
  32. need to press it twice for it to come through.  Also, any ALT key
  33. combo sets the high bit (bit 7).  I can handle this.  I like it, but
  34. my input routine for just ONE char is getting a little hairy.  
  35.  
  36.     Is there a way to make the keys just ONE char?  I want to
  37. have it portable enough to run under BSD and SysV also.  Any ideas how
  38. I can get my keys standard for all these platforms?
  39.  
  40. Thanks,
  41. Dan
  42. Hackers' Guide Coordinator/(playing with my research :)
  43. -- 
  44.  Dan Miner
  45.                                     email: dminer@cs.umr.edu
  46. Computer Science          
  47. University of Missouri-Rolla             "It all begins with a glimmer."
  48.