Crate ncursesw

Source

Modules§

extend
Extended color’s, color pairs and attributes module
features
Compiled in ncursesw features
form
NCurses Form module
menu
NCurses Menu module
mouse
NCurses Mouse module
normal
Normal color’s, color pairs and attributes module
panels
NCurses Panels module
shims
NCurses API shims module

Structs§

ChtypeChar
Ascii character and rendition.
ChtypeString
Ascii string and rendition.
ComplexChar
Complex character (wide character and rendition).
ComplexString
Complex character string (wide characters and renditions).
Origin
Origin using y and x axis
Region
A region of a window.
Size
A size (usually a window).
WideChar
Wide character (UTF-8 character).
WideCharAndAttributes
WideString
Wide character string (UTF-8).

Enums§

AttributesColorPairSet
Normal and extended attributes and color pair returned by ncurses functions.
Changed
Make a line look like it’s been touched since last wrefresh, used by wtouchln.
CharacterResult
Return a GetCharacterType from the getch() and get_wch() families of functions.
CursorType
Cursor type.
Justification
Justification.
KeyBinding
Keys returned by NCurses getch() and get_wch() families of functions.
Legacy
Override locale-encoding checks.
NCursesColorType
The color type that ncursesw is running under. by default it will be ColorType::Normal until a ColorPair structure is generated.
NCurseswError
NCursesw Errors/Events.
Orientation
The screen region (top or bottom) to rip a line off.
SoftLabelType
The soft-label layout type

Traits§

AttributesType
Attributes.
ColorAttributeTypes
Color attribute type in the NCurses library.
ColorPairColors
Color pair’s colors.
ColorPairType
Color pair.
ColorType
Color.
ColorsType
Background and foreground colors.
GetCharacterType
ncursesw get function type.

Functions§

COLORS
Return the number of colors available.
COLOR_PAIRDeprecated
Return the attribute value of a given normal color pair.
COLOR_PAIRS
Return the number of color pairs available.
COLS
Return the number of columns (x-axis) available on the terminal.
ESCDELAY
Return the delay used to interpret termianl keyboard escape sequences.
LINES
Return the number of lines (y-axis) available on the terminal.
PAIR_NUMBERDeprecated
Return the color pair number from given normal attributes value.
TABSIZE
Return the number of columns a tab represents on the terminal.
add_wch
Equivalent of wadd_wch() using stdscr() as window handle.
add_wchnstr
Equivalent of wadd_wchnstr() using stdscr() as window handle.
add_wchstr
Equivalent of wadd_wchstr() using stdscr() as window handle.
addch
Equivalent of waddch() using stdscr() as window handle.
addchnstr
Equivalent of waddchnstr() using stdscr() as window handle.
addchstr
Equivalent of waddchstr() using stdscr() as window handle.
addnstr
Equivalent of waddnstr() using stdscr() as window handle.
addnwstr
Equivalent of waddnwstr() using stdscr() as window handle.
addstr
Equivalent of waddstr() using stdscr() as window handle.
addwstr
Equivalent of waddwstr() using stdscr() as window handle.
assume_default_colors
This defines which colors to paint for color pair 0. This function recognizes a special color Color::TerminalDefault, which denotes the default terminal color.
assume_default_colors_sp
Screen function of assume_default_colors().
attr_get
Equivalent of wattr_get() using stdscr() as window handle.
attr_off
Equivalent of wattr_off() using stdscr() as window handle.
attr_on
Equivalent of wattr_on() using stdscr() as window handle.
attr_set
Equivalent of wattr_set() using stdscr() as window handle.
attroff
Equivalent of wattroff() using stdscr() as window handle.
attron
Equivalent of wattron() using stdscr() as window handle.
attrset
Equivalent of wattron() using stdscr() as window handle.
baudrate
Return the output speed of the terminal in bits per second. On software terminal emulators it will have a fixed high value. Included for historical reasons; in former times, it was used to write output loops for time delays and occasionally to change interfaces depending on the line speed.
baudrate_sp
Screen function of baudrate().
beep
Emit a short attention sound.
beep_sp
Screen function of beep().
bkgd
Set the background property of the window to the character ch. The change is then applied to every character position in that window:
bkgdset
Set the window’s background. A window’s background consists of a character and it’s combination of attributes. The attribute part of the background is combined (OR’ed) with all non-blank characters that are written into the window. Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations.
bkgrnd
Equivalent of wbkgrnd() using stdscr() as window handle.
bkgrndset
Equivalent of wbkgrndset() using stdscr() as window handle.
border
Equivalent of wborder() using stdscr() as window handle.
border_set
Equivalent of wborder_set() using stdscr() as window handle.
box
Similar to border(), but both ls and rs are vertch and both ts and bs are horch. The default corner characters are always used by this function.
box_set
Similar to border_set(), but both ls and rs are vertch and both ts and bs are horch. The default corner characters are always used by this function.
can_change_color
Return true or false, depending on whether the programmer can change the colors displayed by the terminal.
can_change_color_sp
Screen function of can_change_color().
cbreak
Enter cbreak mode. In cbreak mode (sometimes called “rare” mode) normal tty line buffering is turned off and characters are available to be read one by one. However, unlike raw mode, special characters (interrupt, quit, suspend, and flow control) retain their effects on the tty driver and calling program. Calling first raw() then cbreak() leaves the terminal in cbreak mode.
cbreak_sp
Screen function of cbreak().
chgat
Equivalent of wchgat() using stdscr() as window handle.
clear
Equivalent of wclear() using stdscr() as window handle.
clearok
If flag is true, the next call to refresh() will clear the window completely.
clrtobot
Equivalent of wclrtobot() using stdscr() as window handle.
clrtoeol
Equivalent of wclrtoeol() using stdscr() as window handle.
color_contentDeprecated
Return the intensity of the red, green, and blue (RGB) components in the color, which must be between 0 and COLORS. Return a structure, containing the R,G,B values for the given color, which will be between 0 (no component) and 1000 (maximum amount of component).
color_content_spDeprecated
Screen function of color_content().
color_set
Equivalent of wcolor_set() using stdscr() as window handle.
copywin
The copywin() routine provides a finer granularity of control over the overlay() and overwrite() routines. As in the prefresh() routine, a rectangle is specified in the destination window, (dmin) and (dmax), and the upper-left-corner coordinates of the source window, (smin). If the argument overlay is true, then copying is non-destructive, as in overlay().
curs_set
Set the cursor state. visibility can be set to invisible, normal, or very visible. If the terminal supports the visibility requested, return the previous cursor state; otherwise raise an exception. On many terminals, the “visible” mode is an underline cursor and the “very visible” mode is a block cursor.
curs_set_sp
Screen function of curs_set().
curscr
Return the raw pointer to the current screen.
curses_version
Return the version number, including patch level of the underlying library, e.g., 6.1.20180127.
def_prog_mode
Save the current terminal mode as the “program” mode, the mode when the running program is using NCurses. (Its counterpart is the “shell” mode, for when the program is not in NCurses.) Subsequent calls to reset_prog_mode() will restore this mode.
def_prog_mode_sp
Screen function of def_prog_mode().
def_shell_mode
Save the current terminal mode as the “shell” mode, the mode when the running program is not using NCurses. (Its counterpart is the “program” mode, when the program is using NCurses capabilities.) Subsequent calls to reset_shell_mode() will restore this mode.
def_shell_mode_sp
Screen function of def_shell_mode().
define_key
Permits an application to define keycodes with their corresponding control strings, so that the NCurses library will interpret them just as it would the predefined codes in the terminfo database.
define_key_sp
Screen function of define_key().
delay_output
Insert an ms millisecond pause in output.
delay_output_sp
Screen function of delay_output().
delch
Equivalent of wdelch() using stdscr() as window handle.
deleteln
Delete the line under the cursor. All following lines are moved up by one line.
delscreen
The delscreen() routine frees storage associated with the SCREEN data structure. The endwin() routine does not do this, so delscreen() should be called after endwin() if a particular SCREEN is no longer needed.
delwin
Deletes the named window, freeing all memory associated with it (it does not actually erase the window’s screen image). Sub-windows must be deleted before the main window can be deleted.
derwin
An abbreviation for “derive window”, derwin() is the same as calling subwin(), except that origin are relative to the origin of the window, rather than relative to the entire screen. Return a window object for the derived window.
doupdate
Update the physical screen. The NCurses library keeps two data structures, one representing the current physical screen contents and a virtual screen representing the desired next state. The doupdate() ground updates the physical screen to match the virtual screen.
doupdate_sp
Screen function of doupdate().
dupwin
Creates an exact duplicate of the window handle.
echo
Enter echo mode. In echo mode, each character input is echoed to the screen as it is entered.
echo_sp
Screen function of echo().
echo_wchar
Equivalent of wecho_wchar() using stdscr() as window handle.
echochar
Equivalent of wechochar() using stdscr() as window handle.
endwin
De-initialize the library, and return terminal to normal status.
endwin_sp
Screen function of endwin().
erase
Equivalent of werase() using stdscr() as window handle.
erasechar
Return the user’s current erase character as a one-byte bytes object. Under Unix operating systems this is a property of the controlling tty of the NCurses program, and is not set by the NCurses library itself.
erasechar_sp
Screen function of erasechar().
erasewchar
Returns the current erase character as a wide character.
erasewchar_sp
Screen function of erasewchar().
extended_color_contentDeprecated
The extended color version of the color_content() routine.
extended_color_content_spDeprecated
Screen function of extended_color_content().
extended_pair_contentDeprecated
The extended color version of the pair_content() routine.
extended_pair_content_spDeprecated
Screen function of extended_pair_content().
extended_slk_color
The extended color version of the slk_color() routine.
extended_slk_color_sp
Screen function of extended_slk_color().
filter
The filter() routine, if used, must be called before initscr() is called. The effect is that, during those calls, LINES is set to 1; the capabilities clear, cup, cud, cud1, cuu1, cuu, vpa are disabled; and the home string is set to the value of cr. The effect is that the cursor is confined to the current line, and so are screen updates. This may be used for enabling character-at-a-time line editing without touching the rest of the screen.
filter_sp
Screen function of filter().
flash
Flash the screen. That is, change it to reverse-video and then change it back in a short interval. Some people prefer such as ‘visible bell’ to the audible attention signal produced by beep().
flash_sp
Screen function of flash().
flushinp
Flush all input buffers. This throws away any typeahead that has been typed by the user and has not yet been processed by the program.
flushinp_sp
Screen function of flushinp().
free_pairDeprecated
Marks the given color pair as unused, i.e., like color pair 0.
free_pair_spDeprecated
Screen function of free_pair().
get_escdelay
Returns the escape delay.
get_escdelay_sp
Screen function of get_escdelay().
get_wch
Equivalent of wget_wch() using stdscr() as window handle.
get_wstrDeprecated
Equivalent of wget_wstr() using stdscr() as window handle.
getattrs
Returns the same attribute data as wattr_get(). However, getattrs() internally returns an integer (actually a chtype), while wattr_get() returns the current color pair in a separate parameter. In the wide-character library configuration, color pairs may not fit into a chtype, so wattr_get() is the only way to obtain the color information.
getbegx
Return a x of co-ordinates of upper-left corner.
getbegy
Return a y of co-ordinates of upper-left corner.
getbegyx
Return a origin of co-ordinates of upper-left corner.
getbkgd
Return the given window’s current background character (with rendition).
getbkgrnd
Equivalent of wgetbkgrnd() using stdscr() as window handle.
getcchar
Get a widecharacter string and rendition from a complex character.
getch
Equivalent of wgetch() using stdscr() as window handle.
getcurx
Return the x coordinate of the current cursor position.
getcury
Return the y coordinate of the current cursor position.
getcuryx
Return the origin coordinates of the current cursor position.
getmaxx
Return the height of the window.
getmaxy
Return the width of the window.
getmaxyx
Return the height and width of the window.
getn_wstr
Equivalent of wgetn_wstr() using stdscr() as window handle.
getnstr
Equivalent of wgetnstr() using stdscr() as window handle.
getparx
Return the x coordinate of this window relative to its parent window.
getpary
Return the y coordinate of this window relative to its parent window.
getparyx
Return the beginning coordinates of this window relative to its parent window.
getstrDeprecated
Equivalent of wgetstr() using stdscr() as window handle.
getsyx
Return the current coordinates of the virtual screen cursor. If leaveok() is currently true, then return None.
getwin
Read window related data stored in the file by an earlier putwin() call. The routine then creates and initializes a new window using that data, returning the new window object.
getwin_sp
Screen function of getwin().
halfdelay
Used for half-delay mode, which is similar to cbreak mode in that characters typed by the user are immediately available to the program. However, after blocking for tenths tenths of seconds, raise an exception if nothing has been typed. The value of tenths must be a number between 1 and 255. Use nocbreak() to leave half-delay mode.
halfdelay_sp
Screen function of halfdelay().
has_colors
Return true if the terminal can display colors; otherwise, return false.
has_colors_sp
Screen function of has_colors().
has_ic
Return true if the terminal has insert- and delete-character capabilities. This function is included for historical reasons only, as all modern software terminal emulators have such capabilities.
has_ic_sp
Screen function of has_ic().
has_il
Return true if the terminal has insert- and delete-line capabilities, or can simulate them using scrolling regions. This function is included for historical reasons only, as all modern software terminal emulators have such capabilities.
has_il_sp
Screen function of has_il().
has_key
Take a key value ch, and return true if the current terminal type recognizes a key with that value.
has_key_sp
Screen function of has_key().
hline
Equivalent of whline() using stdscr() as window handle.
hline_set
Equivalent of whline_set() using stdscr() as window handle.
idcok
If flag is false, NCurses no longer considers using the hardware insert/delete character feature of the terminal; if flag is true, use of character insertion and deletion is enabled. When NCurses is first initialized, use of character insert/delete is enabled by default.
idlok
If flag is true, NCurses will try and use hardware line editing facilities. Otherwise, line insertion/deletion are disabled.
immedok
If flag is true, any change in the window image automatically causes the window to be refreshed; you no longer have to call refresh() yourself. However, it may degrade performance considerably, due to repeated calls to wrefresh. This option is disabled by default.
in_wch
Equivalent of win_wch() using stdscr() as window handle.
in_wchnstr
Equivalent of win_wchnstr() using stdscr() as window handle.
in_wchstrDeprecated
Equivalent of win_wchstr() using stdscr() as window handle.
inch
Equivalent of winch() using stdscr() as window handle.
inchnstr
Equivalent of winchnstr() using stdscr() as window handle.
inchstrDeprecated
Equivalent of winchstr() using stdscr() as window handle.
init_colorDeprecated
Change the definition of a color, taking the number of the color to be changed followed by three RGB values (for the amounts of red, green, and blue components). The value of color_number must be between 0 and COLORS. Each of r, g, b, must be a value between 0 and 1000. When init_color() is used, all occurrences of that color on the screen immediately change to the new definition. This function is a no-op on most terminals; it is active only if can_change_color() returns true.
init_color_spDeprecated
Screen function of init_color().
init_extended_colorDeprecated
The extended color version of the init_color() routine.
init_extended_color_spDeprecated
Screen function of init_extended_color().
init_extended_pairDeprecated
The extended color version of the init_pair() routine.
init_extended_pair_spDeprecated
Screen function of init_extended_pair().
init_pairDeprecated
Change the definition of a color-pair. It takes two arguments: the number of the color-pair to be changed, and the foreground and background colors. The value of color_pair must be between 1 and COLOR_PAIRS - 1 (the 0 color pair is wired to white on black and cannot be changed). If the color-pair was previously initialized, the screen is refreshed and all occurrences of that color-pair are changed to the new definition.
init_pair_spDeprecated
Screen function of init_pair().
initscr
Initialize the NCurses data structures and return the standard screen.
innstr
Equivalent of winnstr() using stdscr() as window handle.
innwstr
Equivalent of winnwstr() using stdscr() as window handle.
ins_nwstr
Equivalent of ins_nwstr() using stdscr() as window handle.
ins_wch
Equivalent of ins_wch() using stdscr() as window handle.
ins_wstr
Equivalent of ins_wstr() using stdscr() as window handle.
insch
Equivalent of insch() using stdscr() as window handle.
insdelln
Equivalent of insdelln() using stdscr() as window handle.
insertln
Equivalent of insertln() using stdscr() as window handle.
insnstr
Equivalent of insnstr() using stdscr() as window handle.
insstr
Equivalent of insstr() using stdscr() as window handle.
instrDeprecated
Equivalent of instr() using stdscr() as window handle.
intrflush
If the intrflush() option is enabled (flag is true), and 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 NCurses to have the wrong idea of what is on the screen. Disabling the option (flag is false) prevents the flush. The default for the option is inherited from the tty driver settings.
intrflush_sp
Screen function of intrflush().
inwstrDeprecated
Equivalent of inwstr() using stdscr() as window handle.
is_cleared
Returns the value set in clearok().
is_idcok
Returns the value set in idcok().
is_idlok
Returns the value set in idlok().
is_immedok
Returns the value set in immedok().
is_keypad
Returns the value set in keypad().
is_leaveok
Returns the value set in leaveok().
is_linetouched
Return true if the specified line was modified since the last call to refresh(); otherwise return false.
is_nodelay
Returns the value set in nodelay().
is_notimeout
Returns the value set in notimeout().
is_pad
Returns true if the window is a pad i.e., created by newpad().
is_scrollok
Returns the value set in scrollok().
is_subwin
Returns true if the window is a sub-window, i.e., created by subwin() or derwin().
is_syncok
Returns the value set in syncok().
is_term_resized
Return true if resize_term() would modify the window structure, false otherwise.
is_term_resized_sp
Screen function of is_term_resized().
is_wintouched
Return true if the specified window was modified since the last call to refresh(); otherwise return false.
isendwin
Return true if endwin() has been called (that is, the NCurses library has been deinitialized).
isendwin_sp
Screen function of isendwin().
key_defined
Permits an application to determine if a string represented as individual bytes is currently bound to any KeyBindind.
key_defined_sp
Screen function of key_defined().
key_name
Returns a string corresponding to a given KeyBinding.
keybound
Permits an application to determine the string which is defined in the terminfo for specific keycodes.
keybound_sp
Screen function of keybound().
keyname
Return the name of the key binding c. The name of a key generating printable ASCII character is the key’s character. The name of a control-key combination is a two-byte bytes object consisting of a caret (b’^‘) followed by the corresponding printable ASCII character. The name of an alt-key combination (128–255) is a bytes object consisting of the prefix b’M-’ followed by the name of the corresponding ASCII character.
keyname_sp
Screen function of keyname().
keyok
Permits an application to disable specific KeyBinding, rather than use the keypad function to disable all keycodes. Keys that have been disabled can be re-enabled.
keyok_sp
Screen function of keyok().
keypad
If flag is true, escape sequences generated by some keys (keypad, function keys) will be interpreted by NCurses. If flag is false, escape sequences will be left as is in the input stream.
killchar
Return the user’s current line kill character. Under Unix operating systems this is a property of the controlling tty of the NCurses program, and is not set by the NCurses library itself.
killchar_sp
Screen function of killchar().
killwchar
Return the user’s current line kill character as a wide character. Under Unix operating systems this is a property of the controlling tty of the NCurses program, and is not set by the NCurses library itself.
killwchar_sp
Screen function of killwchar().
leaveok
If flag is true, cursor is left where it is on update, instead of being at “cursor position.” This reduces cursor movement where possible. If possible the cursor will be made invisible.
longname
Return the terminfo long name field describing the current terminal. The maximum length of a verbose description is 128 characters. It is defined only after the call to initscr().
longname_sp
Screen function of longname().
mcprint
Ship binary data to printer. Returns the number of characters actually sent to the printer.
mcprint_sp
Screen function of mcprint().
meta
If flag is true, allow 8-bit characters to be input. If flag is false, allow only 7-bit chars.
move
Equivalent of wmove() using stdscr() as window handle.
mvadd_wch
Equivalent of mvwadd_wch() using stdscr() as window handle.
mvadd_wchnstr
Equivalent of mvwadd_wchnstr() using stdscr() as window handle.
mvadd_wchstr
Equivalent of mvwadd_wchstr() using stdscr() as window handle.
mvaddch
Equivalent of mvwaddch() using stdscr() as window handle.
mvaddchnstr
Equivalent of mvwaddchnstr() using stdscr() as window handle.
mvaddchstr
Equivalent of mvwaddchstr() using stdscr() as window handle.
mvaddnstr
Equivalent of mvwaddnstr() using stdscr() as window handle.
mvaddnwstr
Equivalent of mvwaddnwstr() using stdscr() as window handle.
mvaddstr
Equivalent of mvwaddstr() using stdscr() as window handle.
mvaddwstr
Equivalent of mvwaddwstr() using stdscr() as window handle.
mvchgat
Equivalent of mvwchgat() using stdscr() as window handle.
mvcur
The mvcur() routine provides low-level cursor motion. It takes effect immediately (rather than at the next refresh).
mvcur_sp
Screen function of mvcur().
mvdelch
Delete any character at origin.
mvderwin
Move the window inside its parent window. The screen-relative parameters of the window are not changed. This routine is used to display different parts of the parent window at the same physical position on the screen.
mvget_wch
Equivalent of mvwget_wch() using stdscr() as window handle.
mvget_wstrDeprecated
Equivalent of mvwget_wstr() using stdscr() as window handle.
mvgetch
Equivalent of mvwgetch() using stdscr() as window handle.
mvgetn_wstr
Equivalent of mvwgetn_wstr() using stdscr() as window handle.
mvgetnstr
Equivalent of mvwgetnstr() using stdscr() as window handle.
mvgetstrDeprecated
Equivalent of mvwgetstr() using stdscr() as window handle.
mvhline
Equivalent of mvwhline() using stdscr() as window handle.
mvhline_set
Equivalent of mvwhline_set() using stdscr() as window handle.
mvin_wch
Equivalent of mvwin_wch() using stdscr() as window handle.
mvin_wchnstr
Equivalent of mvwin_wchnstr() using stdscr() as window handle.
mvin_wchstrDeprecated
Equivalent of mvwin_wchstr() using stdscr() as window handle.
mvinch
Equivalent of mvwinch() using stdscr() as window handle.
mvinchnstr
Equivalent of mvwinchnstr() using stdscr() as window handle.
mvinchstrDeprecated
Equivalent of mvwinchstr() using stdscr() as window handle.
mvinnstr
Equivalent of mvwinnstr() using stdscr() as window handle.
mvinnwstr
Equivalent of mvwinnwstr() using stdscr() as window handle.
mvins_nwstr
Equivalent of mvwins_nwstr() using stdscr() as window handle.
mvins_wch
Equivalent of mvwins_wch() using stdscr() as window handle.
mvins_wstr
Equivalent of mvwins_wstr() using stdscr() as window handle.
mvinsch
Equivalent of mvwinsch() using stdscr() as window handle.
mvinsnstr
Equivalent of mvwinsnstr() using stdscr() as window handle.
mvinsstr
Equivalent of mvwinsstr() using stdscr() as window handle.
mvinstrDeprecated
Equivalent of mvwinstr() using stdscr() as window handle.
mvinwstrDeprecated
Equivalent of mvwinwstr() using stdscr() as window handle.
mvvline
Equivalent of mvwvline() using stdscr() as window handle.
mvvline_set
Equivalent of mvwvline_set() using stdscr() as window handle.
mvwadd_wch
Paint a complex character wch at origin, overwriting any character previously painted at that location.
mvwadd_wchnstr
Paint a complex character string of at most number characters of wchstr at origin, overwriting anything previously on the window.
mvwadd_wchstr
Paint a complex character string of wchstr at origin, overwriting anything previously on the window.
mvwaddch
Paint character ch at origin, overwriting any character previously painted at that location.
mvwaddchnstr
Paint a character string (with rendition) of chstr of at most number characters at origin, overwriting anything previously on the window.
mvwaddchstr
Paint a character string (with rendition) of chstr at origin, overwriting anything previously on the window.
mvwaddnstr
Paint a string of str with at most number charactersatorigin`, overwriting anything previously on the window.
mvwaddnwstr
Paint a wide string of wstr with at most number characters at origin, overwriting anything previously on the window.
mvwaddstr
Paint a string of str at origin, overwriting anything previously on the window.
mvwaddwstr
Paint a wide string of wstr at origin, overwriting anything previously on the window.
mvwchgat
Set the attributes of number characters at the position origin. This routine moves cursor to position origin. The changed line will be touched using the touchline() method so that the contents will be redisplayed by the next window refresh().
mvwdelch
Delete any character at origin on window.
mvwget_wch
Return an enum of CharacterResult::Character(WideChar) for most keys, or a CharacterResult::Key(KeyBinding) for function keys, keypad keys, and other special keys. In no-delay mode, raise a NCurseswError if there is no input.
mvwget_wstrDeprecated
Read a wide string from the user at origin, with primitive line editing capacity.
mvwgetch
Return an enum of CharacterResult::Character(char) for most keys, or a CharacterResult::Key(KeyBinding) for function keys, keypad keys, and other special keys. In no-delay mode, raise a NCurseswError if there is no input.
mvwgetn_wstr
Read a wide string of at most number characters from the user at origin, with primitive line editing capacity.
mvwgetnstr
Read a string of at most number characters from the user at origin, with primitive line editing capacity.
mvwgetstrDeprecated
Read a string from the user at origin, with primitive line editing capacity.
mvwhline
Display a horizontal line with length number consisting of the character ch at origin.
mvwhline_set
Display a horizontal line with length number consisting of the character wch at origin.
mvwin
Move the window so its upper-left corner is at origin.
mvwin_wch
Return the complex character at the given origin in the window.
mvwin_wchnstr
Return the complex character string of length number at the given origin in the window.
mvwin_wchstrDeprecated
Return the complex character string given origin in the window.
mvwinch
Return the character and rendition at the given origin in the window.
mvwinchnstr
Return the character string and rendition of length number at the given origin in the window.
mvwinchstrDeprecated
Return the character string and rendion at the given origin in the window.
mvwinnstr
Return the character string of length number at the given origin in the window.
mvwinnwstr
Return the wide character string of length number at the given origin in the window.
mvwins_nwstr
Insert a wide string (as many characters as will fit on the line) before the character at origin, up to number characters. If number is zero or negative, the entire string is inserted. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to origin).
mvwins_wch
Insert the complex character wch at origin, moving the cursor position from origin.x right by one character.
mvwins_wstr
Insert a wide string (as many characters as will fit on the line) before the character at origin. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to origin).
mvwinsch
Insert character ch at origin, moving the cursor position from origin.x right by one character.
mvwinsnstr
Insert a string (as many characters as will fit on the line) before the character at origin, up to number characters. If number is zero or negative, the entire string is inserted. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to origin).
mvwinsstr
Insert a string (as many characters as will fit on the line) before the character at origin. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to origin).
mvwinstrDeprecated
Return the string at the given origin in the window.
mvwinwstrDeprecated
Return the wide string at the given origin in the window.
mvwvline
Display a vertical line with length number consisting of the character ch.
mvwvline_set
Display a vertical line with length number consisting of the character wch.
napmsDeprecated
Sleep for ms milliseconds.
napms_spDeprecated
Screen function of namps().
ncurses_colortype
Returns the color type that ncursesw is running under. by default it will be ColorType::Normal until a ColorPair structure is generated.
ncurses_colortype_set
Has the crates color type been set.
ncurses_version
Return the semantic version of the NCurses library.
new_prescr
When creating a new screen, the library uses static variables which have been preset, e.g. by use_env(), filter() etc. With the screen-pointer extension, there are situations where it must create a current screen before the unextended library does. The new_prescr() function is used internally to handle these cases. It is also provided as an entrypoint to allow applications to customize the library initialization.
newpad
The newpad() routine creates and returns a pointer to a new pad data structure with the given size. A pad is like a window, except that it is not restricted by the screen size, and is not necessarily associated with a particular part of the screen. Pads can be used when a large window is needed, and only a part of the window will be on the screen at one time. Automatic refreshes of pads (e.g., from scrolling or echoing of input) do not occur.
newpad_sp
Screen function of newpad().
newscr
Return the raw pointer to the new screen.
newterm
A program that outputs to more than one terminal should use the newterm() routine for each terminal instead of initscr(). A program that needs to inspect capabilities, so it can continue to run in a line-oriented mode if the terminal cannot support a screen-oriented program, would also use newterm(). The routine newterm() should be called once for each terminal. It returns a pointer of type SCREEN which should be saved as a reference to that terminal. newterm’s arguments are:
newterm_sp
Screen function of newterm().
newwin
Return a new window, whose left-upper corner is at origin, and whose height/width is size.
newwin_sp
Screen function of newwin().
nl
Enter newline mode. This mode translates the return key into newline on input, and translates newline into return and line-feed on output. Newline mode is initially on.
nl_sp
Screen function of nl().
nocbreak
Leave cbreak mode. Return to normal “cooked” mode with line buffering.
nocbreak_sp
Screen function of nocbreak().
nodelay
If flag is true, getch() will be non-blocking.
noecho
Leave echo mode. Echoing of input characters is turned off.
noecho_sp
Screen function of noecho().
nofilter
The nofilter() routine cancels the effect of a preceding filter() call. That allows the caller to initialize a screen on a different device, using a different value of $TERM. The limitation arises because the filter() routine modifies the in-memory copy of the terminal information.
nofilter_sp
Screen function of nofilter().
nonl
Leave newline mode. Disable translation of return into newline on input, and disable low-level translation of newline into newline/return on output (but this does not change the behavior of addch('\n'), which always does the equivalent of return and line feed on the virtual screen). With translation off, NCurses can sometimes speed up vertical motion a little; also, it will be able to detect the return key on input.
nonl_sp
Screen function of nonl().
noqiflush
When the noqiflush() routine is used, normal flush of input and output queues associated with the INTR, QUIT and SUSP characters will not be done. You may want to call noqiflush() in a signal handler if you want output to continue as though the interrupt had not occurred, after the handler exits.
noqiflush_sp
Screen function of noqiflush().
noraw
Leave raw mode. Return to normal “cooked” mode with line buffering.
noraw_sp
Screen function of noraw().
notimeout
If flag is true, escape sequences will not be timed out.
overlay
Overlay the window on top of destwin. The windows need not be the same size, only the overlapping region is copied. This copy is non-destructive, which means that the current background character does not overwrite the old contents of destwin.
overwrite
Overlay the window on top of destwin in the same way as overlay() but in a destructive manner.
pair_contentDeprecated
Return a structure containing the colors for the requested color pair. The value of color_pair must be between 1 and COLOR_PAIRS - 1.
pair_content_spDeprecated
Screen function of pair_content().
pecho_wchar
The pecho_wchar() function is the analogous wide-character form of pechochar(). It outputs one character to a pad and immediately refreshes the pad. It does this by a call to wadd_wch() followed by a call to prefresh().
pechochar
The pechochar() routine is functionally equivalent to a call to addch() followed by a call to refresh(), a call to waddch() followed by a call to wrefresh(), or a call to waddch() followed by a call to prefresh(). The knowledge that only a single character is being output is taken into consideration and, for non-control characters, a considerable performance gain might be seen by using these routines instead of their equivalents. In the case of pechochar(), the last location of the pad on the screen is reused for the arguments to prefresh().
pnoutrefresh
The pnoutrefresh() routine is analogous to wnoutrefresh() except that they relate to pads instead of windows. The additional parameters are needed to indicate what part of the pad and screen are involved.
prefresh
The prefresh() routine is analogous to wrefresh() except that they relate to pads instead of windows. The additional parameters are needed to indicate what part of the pad and screen are involved.
putp
At present this function is unimplemented.
putwin
Write all data associated with the window into the provided file. This information can be later retrieved using the getwin() function.
qiflush
When the noqiflush() routine is used, normal flush of input and output queues associated with the INTR, QUIT and SUSP characters will be done.
qiflush_sp
Screen function of qiflush().
raw
Enter raw mode. In raw mode, normal line buffering and processing of interrupt, quit, suspend, and flow control keys are turned off; characters are presented to NCurses input functions one by one.
raw_sp
Screen function of raw().
redrawwin
Touch the entire window, causing it to be completely redrawn on the next call to refresh().
refresh
Update the display immediately (sync actual screen with previous drawing/deleting methods).
reset_color_pairsDeprecated
Reset all defined color pairs.
reset_color_pairs_spDeprecated
Screen function of reset_color_pairs().
reset_prog_mode
Restore the terminal to “program” mode, as previously saved by def_prog_mode().
reset_prog_mode_sp
Screen function of reset_prog_mode().
reset_shell_mode
Restore the terminal to “shell” mode, as previously saved by def_shell_mode().
reset_shell_mode_sp
Screen function of reset_shell_mode().
resetty
Restore the state of the terminal modes to what it was at the last call to savetty().
resetty_sp
Screen function of resetty().
resize_term
Backend function used by resizeterm(), performing most of the work; when resizing the windows, resize_term() blank-fills the areas that are extended. The calling application should fill in these areas with appropriate data. The resize_term() function attempts to resize all windows. However, due to the calling convention of pads, it is not possible to resize these without additional interaction with the application.
resize_term_sp
Screen function of resize_term().
resizeterm
Resize the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by the NCurses library that record the window dimensions (in particular the SIGWINCH handler).
resizeterm_sp
Screen function of resizeterm().
ripoffline
The ripoffline() routine provides access to the same facility that slk_init() uses to reduce the size of the screen. ripoffline() must be called before initscr() or newterm() is called.
ripoffline_sp
Screen function of ripoffline().
savetty
Save the current state of the terminal modes in a buffer, usable by resetty().
savetty_sp
Screen function of savetty().
scr_dump
The scr_dump() routine dumps the current contents of the virtual screen to the file specificed by path.
scr_init
The scr_init() routine reads in the contents of path and uses them to initialize the curses data structures about what the terminal currently has on its screen. If the data is determined to be valid, curses bases its next update of the screen on this information rather than clearing the screen and starting from scratch.
scr_init_sp
Screen function of scr_init().
scr_restore
The scr_restore() routine sets the virtual screen to the contents of the file specificed by path, which must have been written using scr_dump(). The next call to doupdate() restores the physical screen to the way it looked in the dump file.
scr_restore_sp
Screen function of scr_restore().
scr_set
The scr_set() routine is a combination of scr_restore() and scr_init(). It tells the program that the information in path is what is currently on the screen, and also what the program wants on the screen. This can be thought of as a screen inheritance function.
scr_set_sp
Screen function of scr_set().
scrl
For positive n, the scrl() routine scroll the window up n lines (line i+n becomes i); otherwise scroll the window down n lines. This involves moving the lines in the window character image structure. The current cursor position is not changed.
scroll
Scroll the screen upward by 1 lines.
scrollok
Control what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If flag is false, the cursor is left on the bottom line. If flag is true, the window is scrolled up one line. Note that in order to get the physical scrolling effect on the terminal, it is also necessary to call idlok().
set_escdelay
Sets the escape delay delay.
set_escdelay_sp
Screen function of set_escdelay().
set_tabsize
Sets the tab size.
set_tabsize_sp
Screen function of set_tabsize().
set_term
The set_term() routine is used to switch between different terminals. The screen reference new becomes the new current terminal. The previous terminal is returned by the routine. This is the only routine which manipulates SCREEN pointers; all other routines affect only the current terminal.
setcchar
Sets a complex character from a character and rendition.
setscrreg
Set the scrolling region ro region. All scrolling actions will take place in this region.
setsyx
Set the virtual screen cursor to origin. If None then leaveok() is set true.
slk_attr
Retrieve attributes of soft label.
slk_attr_off
Turn off soft label attributes, without affecting other attributes.
slk_attr_on
Turn on soft label attributes, without affecting other attributes.
slk_attr_set
Sets the soft label attributes to attrs, with color specified by color_pair.
slk_attr_set_sp
Screen function of slk_attr_set().
slk_attr_sp
Screen function of slk_attr().
slk_attroff
Turn off attribute attrs of the soft labels.
slk_attroff_sp
Screen function of slk_attroff().
slk_attron
Turn on attribute attrs of the soft labels.
slk_attron_sp
Screen function of slk_attron().
slk_attrset
Sets attribute attrs of the soft labels.
slk_attrset_sp
Screen function of slk_attrset().
slk_clear
Clears the soft labels from the screen.
slk_clear_sp
Screen function of slk_clear().
slk_color
Corresponds to color_set() routine. It has an effect only if soft labels are simulated on the bottom line of the screen.
slk_color_sp
Screen function of slk_color().
slk_init
The slk_init() routine must be called before initscr() or newterm() is called. initscr() eventually uses a line from stdscr() to emulate the soft labels, then fmt determines how the labels are arranged on the screen.
slk_init_sp
Screen function of slk_init().
slk_label
Returns the current label for label number labnum, with leading and trailing blanks stripped.
slk_label_sp
Screen function of slk_label().
slk_noutrefresh
Mark for refresh but wait. This function updates the data structure representing the desired state of the soft labels, but does not force an update of the physical screen. To accomplish that, call doupdate().
slk_noutrefresh_sp
Screen function of slk_noutrefresh().
slk_refresh
Update the soft labels immediately.
slk_refresh_sp
Screen function of slk_refresh().
slk_restore
Restores the soft labels to the screen after a slk_clear() has been performed.
slk_restore_sp
Screen function of slk_restore().
slk_set
The slk_set() routine sets a soft label.
slk_set_sp
Screen function of slk_set().
slk_touch
Forces all the soft labels to be output the next time a slk_noutrefresh() is performed.
slk_touch_sp
Screen function of slk_touch().
slk_wset
The wide string version of the slk_set() routine.
standend
Turn off the standout attribute. On some terminals this has the side effect of turning off all attributes.
standout
Turn on attribute A_STANDOUT.
start_color
Must be called if the programmer wants to use colors, and before any other color manipulation routine is called. It is good practice to call this routine right after initscr().
start_color_sp
Screen function of start_color().
stdscr
Return the raw pointer to the standard screen.
subpad
Return a sub-window, whose upper-left corner is at origin, and whose width/height is size.
subwin
Return a sub-window, whose upper-left corner is at origin, and whose width/height is size.
syncok
If flag is true, then syncup() is called automatically whenever there is a change in the window.
term_attrs
At present this function is unimplemented.
term_attrs_sp
Screen function of term_attrs().
termattrs
At present this function is unimplemented.
termattrs_sp
Screen function of termattrs().
termname
Return the value of the environment variable TERM, as a string, truncated to 14 characters.
termname_sp
Screen function of termname().
tigetflag
Return the value of the Boolean capability corresponding to the terminfo capability name capname as an bool.
tigetnum
Return the value of the numeric capability corresponding to the terminfo capability name capname as an integer or None if it is canceled or absent from the terminal description.
tigetstr
Return the value of the string capability corresponding to the terminfo capability name capname as a bytes object. Return None if capname is not a terminfo “string capability”, or is canceled or absent from the terminal description.
timeout
Set blocking or non-blocking read behavior for the window.
touchline
Pretend that count lines have been changed, beginning with line start.
touchwin
Pretend the whole window has been changed, for purposes of drawing optimizations.
tparm
At present this function is unimplemented.
ttytype
typeahead
Specify that the file descriptor file be used for typeahead checking. If file is None, then no typeahead checking is done.
typeahead_sp
Screen function of typeahead().
unctrl
Return a string which is a printable representation of the character c. Control characters are represented as a caret followed by the character, for example as b’^C’. Printing characters are left as they are.
unctrl_sp
Screen function of unctrl().
unget_wch
Push ch so the next get_wch() will return it.
unget_wch_sp
Screen function of unget_wch().
ungetch
Push ch so the next getch() will return it.
ungetch_sp
Screen function of ungetch().
untouchwin
Mark all lines in the window as unchanged since the last call to refresh().
use_default_colors
Allow use of default values for colors on terminals supporting this feature. Use this to support transparency in your application. The default color is assigned to the color Color::TerminalDefault.
use_default_colors_sp
Screen function of use_default_colors().
use_env
If used, this function should be called before initscr() or newterm() are called. When flag is false, the values of lines and columns specified in the terminfo database will be used, even if environment variables LINES and COLUMNS (used by default) are set, or if NCurses is running in a window (in which case default behavior would be to use the window size if LINES and COLUMNS are not set).
use_env_sp
Screen function of use_env().
use_extended_names
Controls whether the calling application is able to use user-defined or nonstandard names which may be compiled into the terminfo description, i.e., via the terminfo or termcap interfaces. Normally these names are available for use, since the essential decision is made by using the -x option of tic to compile extended terminal definitions. However you can disable this feature to ensure compatibility with other implementations of curses.
use_legacy_coding
Override locale-encoding checks.
use_legacy_coding_sp
Screen function of use_legacy_coding().
use_tioctl
Determine how to compute terminal size. The use_tioctl() routine, if used, should be called before initscr() or newterm() are called (because those compute the screen size).
use_tioctl_sp
Screen function of use_tioctl().
vid_attr
At present this function is unimplemented.
vid_attr_sp
Screen function of vid_attr().
vidattr
At present this function is unimplemented.
vidattr_sp
Screen function of vidattr().
vline
Display a vertical line with length number consisting of the character ch.
vline_set
Display a vertical line with length number consisting of the character ch.
wadd_wch
Equivalent of mvwadd_wch() using getcuryx() as origin.
wadd_wchnstr
Equivalent of mvwadd_wchnstr() using getcuryx() as origin.
wadd_wchstr
Equivalent of mvwadd_wchstr() using getcuryx() as origin.
waddch
Equivalent of mvwaddch() using getcuryx() as origin.
waddchnstr
Equivalent of mvwaddchnstr() using getcuryx() as origin.
waddchstr
Equivalent of mvwaddchstr() using getcuryx() as origin.
waddnstr
Equivalent of mvwaddnstr() using getcuryx() as origin.
waddnwstr
Equivalent of mvwaddnwstr() using getcuryx() as origin.
waddstr
Equivalent of mvwaddstr() using getcuryx() as origin.
waddwstr
Equivalent of mvwaddwstr() using getcuryx() as origin.
wattr_get
Retrieve attributes for the given window.
wattr_off
Turn off window attributes, without affecting other attributes.
wattr_on
Turn on window attributes, without affecting other attributes.
wattr_set
Sets the current attributes of the given window to attrs, with color specified by color_pair.
wattroff
Remove attribute attrs from the “background” set applied to all writes to the current window.
wattron
Add attribute attrs from the “background” set applied to all writes to the current window.
wattrset
Set the “background” set of attributes to attrs. This set is initially no attributes.
wbkgd
Set the background property of the specified window and then apply this setting to every character position in that window.
wbkgdset
Manipulate the background of the specified window. The window background is a character (with rendition). The attribute part of the background is combined (OR’ed) with all non-blank characters that are written into the window with waddch(). Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations.
wbkgrnd
Set the background property of the window to the complex character wch. The change is then applied to every character position in that window:
wbkgrndset
Set the window’s background. A window’s background consists of a character and it’s combination of attributes as a complex character. The attribute part of the background is combined (OR’ed) with all non-blank characters that are written into the window. Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations.
wborder
Draw a border around the edges of the window. Each parameter specifies the character to use for a specific part of the border.
wborder_set
Draw a border around the edges of the window. Each parameter specifies the character to use for a specific part of the border.
wchgat
Equivalent of mvwchgat() using getcuryx() as origin.
wclear
Like erase(), but also cause the whole window to be repainted upon next call to refresh().
wclrtobot
Erase from cursor to the end of the window: all lines below the cursor are deleted, and then the equivalent of clrtoeol() is performed.
wclrtoeol
Erase from cursor to the end of the line.
wcolor_set
Sets the current color of the given window to the foreground/background combination described by the color_pair parameter.
wcursyncup
Update the current cursor position of all the ancestors of the window to reflect the current cursor position of the window.
wdelch
Delete any character at current position.
wecho_wchar
Add a complex character wch, and immediately call refresh() on the window.
wechochar
Add a character (withrendition) ch, and immediately call refresh() on the window.
werase
Clear the window.
wget_wch
Equivalent of mvwget_wch() using getcuryx() as origin.
wget_wstrDeprecated
Equivalent of mvwget_wstr() using getcuryx() as origin.
wgetbkgrnd
Returns the specified window’s current background character as a complex character.
wgetch
Equivalent of mvwgetch() using getcuryx() as origin.
wgetdelay
Returns the delay timeout as set in wtimeout().
wgetn_wstr
Equivalent of mvwgetn_wstr() using getcuryx() as origin.
wgetnstr
Equivalent of mvwgetnstr() using getcuryx() as origin.
wgetparent
Returns the parent WINDOW pointer for sub-windows, or None for windows having no parent.
wgetscrreg
Returns the top and bottom rows for the scrolling margin as set by wsetscrreg().
wgetstrDeprecated
Equivalent of mvwgetstr() using getcuryx() as origin.
whline
Equivalent of mvwhline() using getcuryx() as origin.
whline_set
Equivalent of mvwhline_set() using getcuryx() as origin.
win_wch
Equivalent of mvwin_wch() using getcuryx() as origin.
win_wchnstr
Equivalent of mvwin_wchnstr() using getcuryx() as origin.
win_wchstrDeprecated
Equivalent of mvwin_wchstr() using getcuryx() as origin.
winch
Equivalent of mvwinch() using getcuryx() as origin.
winchnstr
Equivalent of mvwinchnstr() using getcuryx() as origin.
winchstrDeprecated
Equivalent of mvwinchstr() using getcuryx() as origin.
winnstr
Equivalent of mvwinnstr() using getcuryx() as origin.
winnwstr
Equivalent of mvwinnwstr() using getcuryx() as origin.
wins_nwstr
Equivalent of mvwins_nwstr() using getcuryx() as origin.
wins_wch
Equivalent of mvwins_wch() using getcuryx() as origin.
wins_wstr
Equivalent of mvwins_wstr() using getcuryx() as origin.
winsch
Equivalent of mvwinsch() using getcuryx() as origin.
winsdelln
For positive n, insert n lines into the specified window above the current line. The n bottom lines are lost. For negative n, delete n lines (starting with the one under the cursor), and move the remaining lines up. The bottom n lines are cleared. The current cursor position remains the same.
winsertln
Insert a blank line under the cursor. All following lines are moved down by one line.
winsnstr
Equivalent of mvwinsnstr() using getcuryx() as origin.
winsstr
Equivalent of mvwinsstr() using getcuryx() as origin.
winstrDeprecated
Equivalent of mvwinstr() using getcuryx() as origin.
winwstrDeprecated
Equivalent of mvwinwstr() using getcuryx() as origin.
wmove
Move cursor to origin.
wnoutrefresh
Mark for refresh but wait. This function updates the data structure representing the desired state of the window, but does not force an update of the physical screen. To accomplish that, call doupdate().
wredrawln
Indicate that region are corrupted and should be completely redrawn on the next refresh() call.
wrefresh
Update the display immediately (sync actual screen with previous drawing/deleting methods).
wresize
Reallocate storage for a NCurses window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window’s data is filled with blanks that have the current background rendition (as set by bkgdset()) merged into them.
wscrl
For positive n, the wscrl() routine scroll the window up n lines (line i+n becomes i); otherwise scroll the window down n lines. This involves moving the lines in the window character image structure. The current cursor position is not changed.
wsetscrreg
Set the scrolling region ro region. All scrolling actions will take place in this region.
wstandend
Turn off the standout attribute. On some terminals this has the side effect of turning off all attributes.
wstandout
Turn on attribute A_STANDOUT.
wsyncdown
Touch each location in the window that has been touched in any of its ancestor windows. This routine is called by refresh(), so it should almost never be necessary to call it manually.
wsyncup
Touch all locations in ancestors of the window that have been changed in the window.
wtimeout
Set blocking or non-blocking read behavior for the window.
wtouchln
The wtouchln() routine makes n lines in the window, starting at line, look as if they have (Changed::True) or have not (Changed::False) been changed since the last call to wrefresh().
wunctrl
The wunctrl() routine returns a wide character string which is a printable representation of the character ch, ignoring attributes. Control characters are displayed in the ^X notation. Printing characters are displayed as is.
wunctrl_sp
Screen function of wunctrl().
wvline
Equivalent of mvwvline() using getcuryx() as origin.
wvline_set
Equivalent of mvwvline_set() using getcuryx() as origin.

Type Aliases§

RipoffInit
Ripoff line callback function signature.
SCREEN
NCurses screen raw pointer.
WINDOW
NCurses window raw pointer.
attr_t
Raw attribute type value.