| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Keyboard questions |
-=> Neil Heller wrote to All <=-
NH> What I want to do is display a constantly-changing image on the screen
NH> while constantly checking for keyboard input.
There are several ways to do it, but probably the simplest is to use curses
in halfdelay() or nodelay() mode. (The default delay() mode uses a blocking
call.)
NH> I'll be working in ANSI-standard *nix
I don't think you will, because there's no ANSI standard for Unix. :-) If
you mean ANSI C, then AFAICT that's just not powerful enough to do what you
want to do.* You'll have to go to at least the POSIX level (though doing
that via curses is the easy way).
NH> so I can't use any of the neato DOS tricks like checking the keyboard
NH> buffer. ... Does the *nix world have something similar or does
NH> the user _always_ need to press ENTER after typing keyboard input?
ROTFL. DOS is a primitive program loader; Unix is a Real Operating System.
Anything you can do in DOS, you can do at least six ways in Unix.
* I could be wrong. Maybe with signal()?
-=> Neil Heller wrote to Darin McBride <=-
DM> Look at curses ("man curses"). It's somewhat antiquated
DM> (and uuuuugly!), but it works.
NH> Does it work on a SUN machine running Solaris?
Of course.
NH> That's the eventual target platform.
In general, Solaris and Linux are highly compatible. I had an easier time
porting from Linux to Solaris than to any other Unix, including *BSD.
-=> Neil Heller wrote to andrew clarke <=-
ac> There are ports of the Curses library for basically every
ac> platform in use, and in some cases different (but
ac> essentially compatible) "brands" (eg. NCurses vs PDCurses).
NH> That makes it sound like "one more alias required". I
think in the end
NH> that the machine's owner may tell me to take a hike rather than adding
NH> to his system requirements.
Curses is standard on all Unix systems, AFAIK. Certainly it's standard on
Solaris, and _that_ implementation is even fairly decent (though still not
as good as ncurses). Many of the bundled versions are outdated and ought to
be replaced with ncurses; but the old versions may still work for a given
program, depending on how much it exercises the library. Ncurses is already
standard on Linux and, nowadays, on at least some of the BSDs.
There is, of course, no reason that you can't compile ncurses and just keep
it in your home directory, and link statically against that, instead of
installing it globally (and then remove it if you want). I've done this on
a number of systems.
PDCurses is mainly for porting curses apps to DOS, Windows, and OS/2.
... I don't have a life, I have an offline reader.
--- MultiMail/Linux v0.44
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)SEEN-BY: 633/267 270 @PATH: 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.