Manual Pages for UNIX Darwin command on man intrflush
MyWebUniversity

Manual Pages for UNIX Darwin command on man intrflush

cursinopts(3X) cursinopts(3X)

NAME

ccbbrreeaakk, nnooccbbrreeaakk, eecchhoo, nnooeecchhoo, hhaallffddeellaayy, iinnttrrfflluusshh, kkeeyyppaadd, mmeettaa, nnooddeellaayy, nnoottiimmeeoouutt, rraaww, nnoorraaww, nnooqqiifflluusshh, qqiifflluusshh, ttiimmeeoouutt, wwttiimmeeoouutt,

ttyyppeeaahheeaadd - ccuurrsseess input options

SYNOPSIS

##iinncclluuddee <>

iinntt ccbbrreeaakk((vvooiidd));; iinntt nnooccbbrreeaakk((vvooiidd));; iinntt eecchhoo((vvooiidd));; iinntt nnooeecchhoo((vvooiidd));; iinntt hhaallffddeellaayy((iinntt tteenntthhss));; iinntt iinnttrrfflluusshh((WWIINNDDOOWW **wwiinn,, bbooooll bbff));; iinntt kkeeyyppaadd((WWIINNDDOOWW **wwiinn,, bbooooll bbff));; iinntt mmeettaa((WWIINNDDOOWW **wwiinn,, bbooooll bbff));; iinntt nnooddeellaayy((WWIINNDDOOWW **wwiinn,, bbooooll bbff));; iinntt rraaww((vvooiidd));; iinntt nnoorraaww((vvooiidd));; vvooiidd nnooqqiifflluusshh((vvooiidd));; vvooiidd qqiifflluusshh((vvooiidd));; iinntt nnoottiimmeeoouutt((WWIINNDDOOWW **wwiinn,, bbooooll bbff));; vvooiidd ttiimmeeoouutt((iinntt ddeellaayy));; vvooiidd wwttiimmeeoouutt((WWIINNDDOOWW **wwiinn,, iinntt ddeellaayy));; iinntt ttyyppeeaahheeaadd((iinntt ffdd));;

DESCRIPTION

Normally, the tty driver buffers typed characters until a newline or carriage return is typed. The ccbbrreeaakk routine disables line buffering

and erase/kill character-processing (interrupt and flow control charac-

ters are unaffected), making characters typed by the user immediately available to the program. The nnooccbbrreeaakk routine returns the terminal to normal (cooked) mode. Initially the terminal may or may not be in ccbbrreeaakk mode, as the mode is

inherited; therefore, a program should call ccbbrreeaakk or nnooccbbrreeaakk explic-

itly. Most interactive programs using ccuurrsseess set the ccbbrreeaakk mode. Note that ccbbrreeaakk overrides rraaww. [See ccuurrssggeettcchh(3X) for a discussion of how these routines interact with eecchhoo and nnooeecchhoo.] The eecchhoo and nnooeecchhoo routines control whether characters typed by the user are echoed by ggeettcchh as they are typed. Echoing by the tty driver is always disabled, but initially ggeettcchh is in echo mode, so characters typed are echoed. Authors of most interactive programs prefer to do their own echoing in a controlled area of the screen, or not to echo at all, so they disable echoing by calling nnooeecchhoo. [See ccuurrssggeettcchh(3X) for a discussion of how these routines interact with ccbbrreeaakk and nnooccbbrreeaakk.]

The hhaallffddeellaayy routine is used for half-delay mode, which is similar to

ccbbrreeaakk mode in that characters typed by the user are immediately avail-

able to the program. However, after blocking for tenths tenths of sec-

onds, ERR is returned if nothing has been typed. The value of tteenntthhss

must be a number between 1 and 255. Use nnooccbbrreeaakk to leave half-delay

mode. If the iinnttrrfflluusshh option is enabled, (bf is TTRRUUEE), when an interrupt key is pressed on the keyboard (interrupt, break, quit) all output in the tty driver queue will be flushed, giving the effect of faster response to the interrupt, but causing ccuurrsseess to have the wrong idea of what is on the screen. Disabling (bf is FFAALLSSEE), the option prevents the flush. The default for the option is inherited from the tty driver settings. The window argument is ignored.

The kkeeyyppaadd option enables the keypad of the user's terminal. If en-

abled (bf is TTRRUUEE), the user can press a function key (such as an arrow key) and wwggeettcchh returns a single value representing the function key,

as in KKEEYYLLEEFFTT. If disabled (bf is FFAALLSSEE), ccuurrsseess does not treat func-

tion keys specially and the program has to interpret the escape se-

quences itself. If the keypad in the terminal can be turned on (made to transmit) and off (made to work locally), turning on this option causes the terminal keypad to be turned on when wwggeettcchh is called. The default value for keypad is false.

Initially, whether the terminal returns 7 or 8 significant bits on in-

put depends on the control mode of the tty driver [see termio(7)]. To

force 8 bits to be returned, invoke mmeettaa(win, TTRRUUEE); this is equiva-

lent, under POSIX, to setting the CS8 flag on the terminal. To force 7 bits to be returned, invoke mmeettaa(win, FFAALLSSEE); this is equivalent, under POSIX, to setting the CS7 flag on the terminal. The window argument, win, is always ignored. If the terminfo capabilities ssmmmm (metaon) and

rrmmmm (metaoff) are defined for the terminal, ssmmmm is sent to the termi-

nal when mmeettaa(win, TTRRUUEE) is called and rrmmmm is sent when mmeettaa(win, FFAALLSSEE) is called.

The nnooddeellaayy option causes ggeettcchh to be a non-blocking call. If no input

is ready, ggeettcchh returns EERRRR. If disabled (bf is FFAALLSSEE), ggeettcchh waits until a key is pressed. While interpreting an input escape sequence, wwggeettcchh sets a timer while waiting for the next character. If nnoottiimmeeoouutt((win, TTRRUUEE) is called, then wwggeettcchh does not set a timer. The purpose of the timeout is to differentiate between sequences received from a function key and those typed by a user. The rraaww and nnoorraaww routines place the terminal into or out of raw mode.

Raw mode is similar to ccbbrreeaakk mode, in that characters typed are imme-

diately passed through to the user program. The differences are that in raw mode, the interrupt, quit, suspend, and flow control characters are all passed through uninterpreted, instead of generating a signal. The behavior of the BREAK key depends on other bits in the tty driver that are not set by ccuurrsseess. When the nnooqqiifflluusshh routine is used, normal flush of input and output queues associated with the IINNTTRR, QQUUIITT and SSUUSSPP characters will not be done [see termio(7)]. When qqiifflluusshh is called, the queues will be flushed when these control characters are read. You may want to call nnooqqiifflluusshh(()) in a signal handler if you want output to continue as though the interrupt had not occurred, after the handler exits.

The ttiimmeeoouutt and wwttiimmeeoouutt routines set blocking or non-blocking read for

a given window. If delay is negative, blocking read is used (i.e.,

waits indefinitely for input). If delay is zero, then non-blocking

read is used (i.e., read returns EERRRR if no input is waiting). If delay is positive, then read blocks for delay milliseconds, and returns EERRRR if there is still no input. Hence, these routines provide the same functionality as nnooddeellaayy, plus the additional capability of being able to block for only delay milliseconds (where delay is positive).

The ccuurrsseess library does ``line-breakout optimization'' by looking for

typeahead periodically while updating the screen. If input is found,

and it is coming from a tty, the current update is postponed until rree-

ffrreesshh or ddoouuppddaattee is called again. This allows faster response to com-

mands typed in advance. Normally, the input FILE pointer passed to nneewwtteerrmm, or ssttddiinn in the case that iinniittssccrr was used, will be used to do this typeahead checking. The ttyyppeeaahheeaadd routine specifies that the file descriptor fd is to be used to check for typeahead instead. If fd is

-1, then no typeahead checking is done.

RREETTUURRNN VVAALLUUEE All routines that return an integer return EERRRR upon failure and OK (SVr4 specifies only "an integer value other than EERRRR") upon successful

completion, unless otherwise noted in the preceding routine descrip-

tions. X/Open does not define any error conditions. In this implementation, functions with a window parameter will return an error if it is null.

Any function will also return an error if the terminal was not initial-

ized. Also, hhaallffddeellaayy returns an error if its parameter is outside the range 1..255. PPOORRTTAABBIILLIITTYY These functions are described in the XSI Curses standard, Issue 4. The ncurses library obeys the XPG4 standard and the historical practice of the AT&T curses implementations, in that the echo bit is cleared when curses initializes the terminal state. BSD curses differed from this slightly; it left the echo bit on at initialization, but the BSD

rraaww call turned it off as a side-effect. For best portability, set

echo or noecho explicitly just after initialization, even if your pro-

gram remains in cooked mode. NNOOTTEESS Note that eecchhoo, nnooeecchhoo, hhaallffddeellaayy, iinnttrrfflluusshh, mmeettaa, nnooddeellaayy, nnoottiimmeeoouutt, nnooqqiifflluusshh, qqiifflluusshh, ttiimmeeoouutt, and wwttiimmeeoouutt may be macros. The nnoorraaww and nnooccbbrreeaakk calls follow historical practice in that they attempt to restore to normal (`cooked') mode from raw and cbreak modes respectively. Mixing raw/noraw and cbreak/nocbreak calls leads to tty driver control states that are hard to predict or understand; it is not recommended.

SEE ALSO

ccuurrsseess(3X), ccuurrssggeettcchh(3X), ccuurrssiinniittssccrr(3X), tteerrmmiioo(7) cursinopts(3X)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™