home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1996 September / Simtel-MSDOS-Sep1996-CD1.iso / disc1 / screen / ansi_esc.doc < prev    next >
Text File  |  1986-04-04  |  4KB  |  78 lines

  1.                               ANSI ESCAPE SEQUENCES
  2. ===============================================================================
  3. Wherever you see '#', that should be replaced by the appropriate number.
  4.  
  5.         ESC code sequence                       Function
  6.        -------------------              ---------------------------
  7. Cursor Controls:
  8.          ESC[#;#H or ESC[#;#f           Moves cusor to line #, column #
  9.          ESC[#A                         Moves cursor up # lines
  10.          ESC[#B                         Moves cursor down # lines
  11.          ESC[#C                         Moves cursor forward # spaces
  12.          ESC[#D                         Moves cursor back # spaces
  13.          ESC[#;#R                       Reports current cursor line & column
  14.          ESC[s                          Saves cursor position for recall later
  15.          ESC[u                          Return to saved cursor position
  16.  
  17. Erase Functions:
  18.          ESC[2J                         Clear screen and home cursor
  19.          ESC[K                          Clear to end of line
  20.  
  21. Set Graphics Rendition:
  22.          ESC[#;#;....;#m                Set display attributes where # is
  23.                                             0 for normal display
  24.                                             1 for bold on
  25.                                             4 underline (mono only)
  26.                                             5 blink on
  27.                                             7 reverse video on
  28.                                             8 nondisplayed (invisible)
  29.                                             30 black foreground 
  30.                                             31 red foreground 
  31.                                             32 green foreground 
  32.                                             33 yellow foreground 
  33.                                             34 blue foreground 
  34.                                             35 magenta foreground 
  35.                                             36 cyan foreground 
  36.                                             37 white foreground
  37.                                             40 black background
  38.                                             41 red background
  39.                                             42 green background
  40.                                             43 yellow background
  41.                                             44 blue background
  42.                                             45 magenta background
  43.                                             46 cyan background
  44.                                             47 white background
  45.  
  46.          ESC[=#;7h or                   Put screen in indicated mode where # is
  47.          ESC[=h or                          0 for 40 x 25 black & white
  48.          ESC[=0h or                         1 for 40 x 25 color
  49.          ESC[?7h                            2 for 80 x 25 b&w
  50.                                             3 for 80 x 25 color
  51.                                             4 for 320 x 200 color graphics
  52.                                             5 for 320 x 200 b & w graphics
  53.                                             6 for 640 x 200 b & w graphics
  54.                                             7 to wrap at end of line 
  55.  
  56.          ESC[=#;7l or ESC[=l or         Resets mode # set with above command
  57.          ESC[=0l or ESC[?7l
  58.  
  59. Keyboard Reassignments:
  60.          ESC[#;#;...p                   Keyboard reassignment. The first ASCII
  61.          or ESC["string"p               code defines which code is to be 
  62.          or ESC[#;"string";#;           changed. The remaining codes define
  63.             #;"string";#p               what it is to be changed to.
  64.  
  65.          E.g. Reassign the Q and q keys to the A and a keys (and vice versa).
  66.          ESC [65;81p                    A becomes Q
  67.          ESC [97;113p                   a becomes q
  68.          ESC [81;65p                    Q becomes A
  69.          ESC [113;97p                   q becomes a
  70.  
  71.          E.g. Reassign the F10 key to a DIR command.
  72.          ESC [0;68;"dir";13p            The 0;68 is the extended ASCII code 
  73.                                         for the F10 key and 13 is the ASCII
  74.                                         code for a carriage return.
  75.          
  76.          Other function key codes       F1=59,F2=60,F3=61,F4=62,F5=63
  77.                                         F6=64,F7=65,F8=66,F9=67,F10=68
  78.