The ANSI.sys Esc [6n cursor position report function is supported by ANSIPLUS. ANSIPLUS also accepts extended options to return other information about its current state. The available ANSIPLUS Esc [#n queries are shown in the following table:
|
Each status report returns two or four integers as part of an escape sequence supplied to DOS keyboard input; the R in the report is followed by a carriage return:
Esc [#;#R Enter or Esc [#;#;#;#R Enter
Option 136 reports the first 32 ANSIPLUS features settings as two 16-bit numbers bit-encoded in the same order as the features listed under " Enable or disable driver features " below. Thus, for example, bright key echo, if enabled, adds one to the first result, and smooth scrolling, if enabled, adds 4096.
Option 137’s video mode description sums two nibbles. The high order nibble value describes the video board: 16=EGA, 32=VGA, 0=other. The low order nibble describes the current operating mode: 0=text mode, 1=CGA/other graphics, 2=VGA/EGA 16 color or monochrome graphics, 3=VGA 256-color graphics.
Options 138 and 139 can be used to save and restore colors. The color codes returned may be passed directly to Esc [m later to set the colors. The foreground is returned with either 128 or 256 added, and the background is returned with either 192 or 512 added.
Option 140 returns the current or default color, VGA/EGA palette or VGA DAC definition of the color selected by a second parameter. See the adjacent table for the color selectors acceptable for the second parameter. Four numbers are reported: the EGA palette or VGA DAC code used to obtain the color definition, and red, green and blue color intensities from 0 to 255. Option 141 returns a pointer to the current ANSIPLUS beep tone definition. The tone definition consists of a list of 16-bit word pairs containing frequency in Hertz and duration in milliseconds, terminated by two words of zeros. The data at the memory location returned must not be modified. |
|
Option 142 returns a pointer to the reassignment of a key selected by a second (or for function-type keys, a second and third) parameter. If the key is not currently reassigned, both the offset and segment returned will be zero. The reassignment pointed to consists of a 16-bit word length, followed by a character string of that length. The data at the memory location returned must not be modified.
Option 143 reports text treatment settings as two 16-bit numbers bit-encoded according to the table to the right. Option 144 reports the second 32 ANSIPLUS features settings bit-encoded like Option 136. Options 146 to 148 support screen scrolling regions by reporting the actual screen size and the minimum and maximum limits for the current scrolling region. |
|
The Esc [!g control sequence defines the Ctrl+G beep tone by a series of up to 10 pairs of parameters (the limit is configurable). Each pair consists of a frequency in Hertz, and a duration in milliseconds. A frequency of zero is interpreted as silence. If no parameters are supplied, a default tone of 880 Hz is installed. For example:
Esc [!g | Restore the default tone of 880Hz for 385 ms |
Esc [!1397,110,1047,165g | Install a two-tone beep |
Esc [!0,55g | Install a silent beep |
The Esc [p control sequence is used to define key reassignment. The first parameter defines the key to be reassigned (or the first two for Alt or function keys), and all remaining parameters define the key reassignment character string. If a key parameter is not followed by a reassignment string, then any existing reassignment for that key is deleted. If Esc [p is supplied with no parameters at all, then all key reassignments will be deleted. For example:
Esc [0;17;"Hello World!";13p | Make the Alt+W key enter "Hello World!" |
The dark gray keys on enhanced keyboards ( PgUp, Home, etc.) may be reassigned independently from the corresponding keys on the numeric keypad. Any key code that starts with 224 before the scan code instead of 0 will reassign the gray key only, and not the key on the numeric keypad. A key code that starts with zero will reassign both keys, unless the gray key has its own independent reassignment. So, for example:
Esc [224;71;"Gray Home"p | Reassign Gray Home key only |
Esc [0;71;"Home"p | Reassign either Home or Gray Home |
The gray keys on the numeric keypad may also be reassigned using the following codes:
Esc [224;13;"Gray Enter"p | Reassign Gray Enter key |
Esc [224;43;"Gray Plus"p | Reassign Gray "+" key |
Esc [224;45;"Gray Minus"p | Reassign Gray "-" key |
Esc [224;42;"Gray Times"p | Reassign Gray "*" key |
Esc [224;47;"Gray Divide"p | Reassign Gray "/" key |
The Esc [!k control sequence is used to add keys to the keyboard input buffer, simulating keystrokes by the user. Each parameter defines a keystroke. A parameter value of -1 indicates that the next parameter will be a time delay in 55 millisecond timer ticks before returning the next key. For example:
Esc [!"Hello";-1;18;" World!"k | Enter "Hello", wait 1 second, then " World!" |
The Esc [!w control sequence is used to insert a time delay during console output. Its intended use is for displaying ANSI data (eg., ANSI animation) to cause pauses without user intervention or more complicated programming. A single parameter value is accepted: the time delay in 55 millisecond timer ticks before returning. For example:
Esc [!36w | Wait 2 seconds before proceeding |
The Esc [w wait loop can be aborted at any time by hitting either Esc or Ctrl+Break.
Several ANSIPLUS features may be turned on or off by programs with the Esc [!d ANSIPLUS control sequence, which accepts zero or more control codes from the following. A parameter value of zero resets all ANSIPLUS features to default settings. The same thing occurs if no parameters are supplied.
|
© Copyright 2000-2007, Kristofer Sweger. All rights reserved. |
Rev. 10/16/07 |