home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:12827 comp.unix.questions:10417
- Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!oxuniv!atmtjkv
- From: atmtjkv@vax.oxford.ac.uk
- Newsgroups: comp.lang.c,comp.unix.questions
- Subject: Re: cursor input on curses (new prob.)
- Message-ID: <1992Aug26.082112.8513@vax.oxford.ac.uk>
- Date: 26 Aug 92 07:21:12 GMT
- References: <1992Aug25.220112.1@hamp.hampshire.edu>
- Organization: Oxford University VAX 6620
- Lines: 28
-
- In article <1992Aug25.220112.1@hamp.hampshire.edu>, jmolinari@hamp.hampshire.edu writes:
- >
- > A while ago I posted a question dealing with the curses library
- > package. I asked how I could handle cursor input, e.g., "cursor-up, down,
- > etc." Several people replied with variations of "use the keypad() function".
- > Problem is, keypad() doesn't seem to be implemented in our package of curses
- > (which is installed on a sun3 system). It's not in the curses.h file, nor in
- > any of ther OTHER headers in our collection (I GREPped the directory, so I'm at
- > quite a loss. If anybody can explain this and/or offer a solution, I will be
- > able to finish an ascii version of Minesweeper I'm working on for school.
- > Thank you!
- > jmolinari@hamp.hampshire.edu
-
- It's a tricky problem. To be really portable and terminal
- independent, you have to parse the keystrokes and compare them
- with the values given in TERMCAP or its equivalent. I haven't seen
- a version of curses that includes this, and most termcap files have
- *very* scanty information about key codes, particularly for function keys --
- they normally stop with up, down, left and right. I have a routine to
- do this parsing, and some fuller termcap entries, if you're interested.
- It reads the termcap file at run time, so it can cope with changes of
- terminal type.
-
- --
- Tim Kingsmill-Vellacott
- Atmospheric, Oceanic and Planetary Physics
- University of Oxford, UK.
- tjkv@atm.ox.ac.uk preferred
-