curses_intro.3x (2010 09)
c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
subwindow, and then restoring the subwindow may disturb the appearance of the screen. To overcome
these effects (for example, for pop-up windows), the application should refresh the entire screen.
Special Characters
Some functions process special characters as specified below.
In functions that do not move the cursor based on the information placed in the window, these special
characters would only be used within a string in order to affect the placement of subsequent characters;
the cursor movement specified below does not persist in the visible cursor beyond the end of the opera-
tion. In functions that do move the cursor, these special characters can be used to affect the placement of
subsequent characters and to achieve movement of the visible cursor.
backspace Unless the cursor was already in column 0, backspace moves the cursor one
column toward the start of the current line and any characters after the back-
space are added or inserted starting there.
carriage return Unless the cursor was already in column 0, carriage return moves the cursor
to the start of the current line. Any characters after the carriage return are
added or inserted starting there.
newline In an add operation, Curses adds the background character into successive
columns until reaching the end of the line. Scrolling occurs as described in
Truncation, Wrapping and Scrolling . Any characters after the newline char-
acter are added at the start of the new line.
In an insert operation, newline moves the cursor to the start of a new line
(causing scrolling as described in Truncation, Wrapping and Scrolling ). Any
characters after the newline character are placed at the start of the new line.
The
filter() function may inhibit this processing.
tab Tab characters in text move subsequent characters to the next horizontal tab
stop. By default, tab stops are in column 0, 8, 16, and so on.
In an insert or add operation, Curses inserts or adds, respectively, the background character into
successive columns until reaching the next tab stop. If there are no more tab stops in the current
line, wrapping and scrolling occur as described in Truncation, Wrapping and Scrolling.
Control Characters
The Curses functions that perform special-character processing conceptually convert control characters to
the caret (ˆ) character followed by a second character (which is an uppercase letter if it is alphabetic) and
write this string to the window in place of the control character. The functions that retrieve text from the
window will not retrieve the original control character.
Rendition of Characters Placed into a Window
When the application adds or inserts characters into a window, the effect is as follows:
If the character is not the space character, then the window receives:
• the character that the application specifies
• the colour that the application specifies; or the window colour, if the application does not specify a
colour
• the attributes specified, ORed with the window attributes.
If the character is the space character, then the window receives:
• the background character
• the colour that the application specifies; or the background colour, if the application does not specify
a colour
• the attributes specified, ORed with the background attributes.
Input Processing
The Curses input model provides a variety of ways to obtain input from the keyboard.
Keypad Processing
The application can enable or disable keypad translation by calling
keypad(). When translation is
enabled, Curses attempts to translate a sequence of terminal input that represents the pressing of a
HP-UX 11i Version 3: September 2010 − 9 − Hewlett-Packard Company 9