Hints for using curses

Bill Stapleton wls at csd4.csd.uwm.edu
Wed Dec 13 09:37:34 AEST 1989


In article <532 at mwtech.UUCP> martin at mwtech.UUCP (Martin Weitzel) writes:
>... some 'rules', for writing 'portable' application using curses:
>3) Key codes:
>   IMHO, it's save to assume that the four "ARROW"-Keys and "HOME" 
>   are present on any todays keyboard, as well as ten F-Keys.

I think its best to stay away from function keys - There are only nine on
this Zenith Z-49, and the first 4 have been reprogrammed to useful strings.
You also have to account for key labelling - I guess I have ten F-keys, but
one is labelled "HELP", not to be confused with PF1 - PF4 or F5 - F9.
I used to have an old klunker at home that used ^Z in one of its arrow-key
sequences, unusable with csh. 

In fact, if you want to be really safe, I think you're better off not assuming
anything.  There are still places with ancient terminals, and what with
programmable keys and stuff, there's no telling what the user can actually
input.  I like the common practice of recognizing alternate key sequences,
like arrow keys AND h-j-k-l, so people can use whatever works best.  If I get
a program that says type F1 to gorf, I'm stuck...

--
Bill Stapleton
     wls at csd4.csd.uwm.edu
     uwmcsd4!wls



More information about the Comp.unix.wizards mailing list