Ncurses terminal screen control functionsncurses functions
&warn.experimental;
What is ncurses?
ncurses (new curses) is a free software emulation of curses in
System V Rel 4.0 (and above). It uses terminfo format, supports pads, colors, multiple
highlights, form characters and function key mapping.
Platforms
Ncurses is available for the following platforms:
AIXBeOSCygwinDigital Unix (aka OSF1)FreeBSDGNU/LinuxHPUXIRIXOS/2SCO OpenServerSolarisSunOSRequirements
You need the ncurses libraries and headerfiles. Download the
latest version from the &url.ncurses; or from an other GNU-Mirror.
Installation
To get these functions to work, you have to compile the CGI
version of PHP with .
Ncurses predefined constantsError codes
On error ncurses functions return NCURSES_ERR.
Colors
ncurses color constantsconstantmeaningNCURSES_COLOR_BLACKno color (black)NCURSES_COLOR_WHITEwhiteNCURSES_COLOR_REDred - supported when terminal is in color modeNCURSES_COLOR_GREENgreen - supported when terminal is in color modNCURSES_COLOR_YELLOWyellow - supported when terminal is in color modNCURSES_COLOR_BLUEblue - supported when terminal is in color modNCURSES_COLOR_CYANcyan - supported when terminal is in color modNCURSES_COLOR_MAGENTAmagenta - supported when terminal is in color mod
Keys
ncurses key constantsconstantmeaningNCURSES_KEY_F0 - NCURSES_KEY_F64function keys F1 - F64NCURSES_KEY_DOWNdown arrowNCURSES_KEY_UPup arrowNCURSES_KEY_LEFTleft arrowNCURSES_KEY_RIGHTright arrowNCURSES_KEY_HOMEhome key (upward+left arrow)NCURSES_KEY_BACKSPACEbackspaceNCURSES_KEY_DLdelete lineNCURSES_KEY_ILinsert lineNCURSES_KEY_DCdelete characterNCURSES_KEY_ICinsert char or enter insert modeNCURSES_KEY_EICexit insert char modeNCURSES_KEY_CLEARclear screenNCURSES_KEY_EOSclear to end of screenNCURSES_KEY_EOLclear to end of lineNCURSES_KEY_SFscroll one line forwardNCURSES_KEY_SRscroll one line backwardNCURSES_KEY_NPAGEnext pageNCURSES_KEY_PPAGEprevious pageNCURSES_KEY_STABset tabNCURSES_KEY_CTABclear tabNCURSES_KEY_CATABclear all tabsNCURSES_KEY_SRESETsoft (partial) resetNCURSES_KEY_RESETreset or hard resetNCURSES_KEY_PRINTprintNCURSES_KEY_LLlower leftNCURSES_KEY_A1upper left of keypadNCURSES_KEY_A3upper right of keypadNCURSES_KEY_B2center of keypadNCURSES_KEY_C1lower left of keypadNCURSES_KEY_C3lower right of keypadNCURSES_KEY_BTABback tabNCURSES_KEY_BEGbeginningNCURSES_KEY_CANCELcancelNCURSES_KEY_CLOSEcloseNCURSES_KEY_COMMANDcmd (command)NCURSES_KEY_COPYcopyNCURSES_KEY_CREATEcreateNCURSES_KEY_ENDendNCURSES_KEY_EXITexitNCURSES_KEY_FINDfindNCURSES_KEY_HELPhelpNCURSES_KEY_MARKmarkNCURSES_KEY_MESSAGEmessageNCURSES_KEY_MOVEmoveNCURSES_KEY_NEXTnextNCURSES_KEY_OPENopenNCURSES_KEY_OPTIONSoptionsNCURSES_KEY_PREVIOUSpreviousNCURSES_KEY_REDOredoNCURSES_KEY_REFERENCEref (reference)NCURSES_KEY_REFRESHrefreshNCURSES_KEY_REPLACEreplaceNCURSES_KEY_RESTARTrestartNCURSES_KEY_RESUMEresumeNCURSES_KEY_SAVEsaveNCURSES_KEY_SBEGshiftet beg (beginning)NCURSES_KEY_SCANCELshifted cancelNCURSES_KEY_SCOMMANDshifted commandNCURSES_KEY_SCOPYshifted copyNCURSES_KEY_SCREATEshifted createNCURSES_KEY_SDCshifted delete charNCURSES_KEY_SDLshifted delete lineNCURSES_KEY_SELECTselectNCURSES_KEY_SENDshifted endNCURSES_KEY_SEOLshifted end of lineNCURSES_KEY_SEXITshifted exitNCURSES_KEY_SFINDshifted findNCURSES_KEY_SHELPshifted helpNCURSES_KEY_SHOMEshifted homeNCURSES_KEY_SICshifted inputNCURSES_KEY_SLEFTshifted left arrowNCURSES_KEY_SMESSAGEshifted messageNCURSES_KEY_SMOVEshifted moveNCURSES_KEY_SNEXTshifted nextNCURSES_KEY_SOPTIONSshifted optionsNCURSES_KEY_SPREVIOUSshifted previousNCURSES_KEY_SPRINTshifted printNCURSES_KEY_SREDOshifted redoNCURSES_KEY_SREPLACEshifted replaceNCURSES_KEY_SRIGHTshifted right arrowNCURSES_KEY_SRSUMEshifted resumeNCURSES_KEY_SSAVEshifted saveNCURSES_KEY_SSUSPENDshifted suspendNCURSES_KEY_UNDOundoNCURSES_KEY_MOUSEmouse event has occuredNCURSES_KEY_MAXmaximum key value
Mouse
mouse constantsConstantmeaningNCURSES_BUTTON1_RELEASED - NCURSES_BUTTON4_RELEASEDbutton (1-4) releasedNCURSES_BUTTON1_PRESSED - NCURSES_BUTTON4_PRESSEDbutton (1-4) pressedNCURSES_BUTTON1_CLICKED - NCURSES_BUTTON4_CLICKEDbutton (1-4) clickedNCURSES_BUTTON1_DOUBLE_CLICKED -
NCURSES_BUTTON4_DOUBLE_CLICKEDbutton (1-4) double clickedNCURSES_BUTTON1_TRIPLE_CLICKED -
NCURSES_BUTTON4_TRIPLE_CLICKEDbutton (1-4) triple clickedNCURSES_BUTTON_CTRLctrl pressed during clickNCURSES_BUTTON_SHIFTshift pressed during clickNCURSES_BUTTON_ALTalt pressed during clickNCURSES_ALL_MOUSE_EVENTSreport all mouse eventsNCURSES_REPORT_MOUSE_POSITIONreport mouse position