home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
RiscOS
/
APP
/
DEVS
/
FORTH
/
BEETLE
/
BEETLE.ZIP
/
Beetle
/
noecho.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-22
|
730b
|
38 lines
/* NOECHO.C
Vrsn Date Comment
----|-------|---------------------------------------------------------------
0.00 02apr95 Adapted from Martin Richards's code.
Reuben Thomas
void init_keyb(void) initialises the keyboard interface.
void restore_keyb(void) restores the keyboard to its original state.
*/
#define BSD_COMP
#include <stdio.h>
#include <sys/ioctl.h>
#include <sgtty.h>
void init_keyb(void)
{
struct sgttyb ttyb;
ioctl(0, TIOCGETP, &ttyb);
ttyb.sg_flags = CBREAK+EVENP+ODDP+CRMOD;
ioctl(0, TIOCSETP, &ttyb);
}
void restore_keyb(void)
{
struct sgttyb ttyb;
ioctl(0, TIOCGETP, &ttyb);
ttyb.sg_flags = ECHO+EVENP+ODDP+CRMOD;
ioctl(0, TIOCSETP, &ttyb);
}