curses.keyname()

curses.keyname(k) Return the name of the key numbered k. The name of a key generating printable ASCII character is the key’s character. The name of a control-key combination is a two-character string consisting of a caret followed by the corresponding printable ASCII character. The name of an alt-key combination (128-255) is a string consisting of the prefix ‘M-‘ followed by the name of the corresponding ASCII character.

curses.initscr()

curses.initscr() Initialize the library. Return a WindowObject which represents the whole screen. Note If there is an error opening the terminal, the underlying curses library may cause the interpreter to exit.

curses.init_pair()

curses.init_pair(pair_number, fg, bg) Change the definition of a color-pair. It takes three arguments: the number of the color-pair to be changed, the foreground color number, and the background color number. The value of pair_number must be between 1 and COLOR_PAIRS - 1 (the 0 color pair is wired to white on black and cannot be changed). The value of fg and bg arguments must be between 0 and COLORS. If the color-pair was previously initialized, the screen is refreshed and all occurrences of

curses.init_color()

curses.init_color(color_number, r, g, b) 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_ch

curses.isendwin()

curses.isendwin() Return True if endwin() has been called (that is, the curses library has been deinitialized).

curses.has_key()

curses.has_key(ch) Take a key value ch, and return True if the current terminal type recognizes a key with that value.

curses.has_colors()

curses.has_colors() Return True if the terminal can display colors; otherwise, return False.

curses.has_ic()

curses.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.

curses.has_il()

curses.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.

curses.getsyx()

curses.getsyx() Return the current coordinates of the virtual screen cursor in y and x. If leaveok is currently true, then -1,-1 is returned.