Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
custom:ctrl-a_codes [2011/06/17 15:46] – digitalman | custom:ctrl-a_codes [2020/05/11 18:02] – [Control] Add mouse hot-spot related Ctrl-A codes digital man |
---|
====== Ctrl-A Codes ====== | ====== Attribute (Ctrl-A) Codes ====== |
"Control A" codes (a.k.a. ^A codes) are terminal control sequences embedded in Synchronet text and menu display files. | //Attribute Codes// (a.k.a. ^A codes) are terminal control sequences embedded in Synchronet text and menu display files. |
| |
===== Background ===== | ===== Background ===== |
| |
===== Use ===== | ===== Use ===== |
Ctrl-A codes are 2-character sequences which begin with a Ctrl-A (ASCII 1) character (hence the name) and are followed by a single character (case insensitive) which determines the operation to be performed. The only exception to this 2-character sequences is the Ctrl-A''"//filename//'' code, which takes a filename as an argument and the filename is considered part of the sequence and not displayed. | Ctrl-A codes are 2-character sequences which begin with a Ctrl-A (ASCII 1) character (hence the name) and are followed by a single character (case insensitive) which determines the operation to be performed. The only exception to this 2-character sequence is the Ctrl-A''"//filename//'' code, which takes a filename as an argument and the filename is considered part of the sequence and not displayed. |
| |
It can sometimes require a special purpose text editor to actually enter a Ctrl-A character into a text file. Some editors may require a special key sequence or use of a menu option to enter a Ctrl-A character into a file. The graphical representation of the character may be a happy face or any other non-alphanumeric symbol that the editor chooses to render to represent that character code. There are [[javascript|@-Codes]] for the equivalent of many of the Ctrl-A codes, so may consider using them if they are more convenient for your text editor of choice. | It can sometimes require a special purpose text editor to actually enter a Ctrl-A character into a text file. Some editors may require a special key sequence or use of a menu option to enter a Ctrl-A character into a file. The graphical representation of the character may be a happy face or any other non-alphanumeric symbol that the editor chooses to render to represent that character code. There are [[atcodes|@-Codes]] for the equivalent of many of the Ctrl-A codes, so may consider using them if they are more convenient for your text editor of choice. |
| |
In the ''[[custom:text.dat]]'' and possibly some other files, Ctrl-A characters may be entered using the C escape sequence: ''\1''. | In the ''[[custom:text.dat]]'' and possibly some other files (e.g. [[JavaScript]] and [[:util:Baja]] source files), Ctrl-A characters may be included by using the escape sequence ''\1'' (or ''\x01'') rather than having to insert an actual control character into the file. |
| |
The [[util:ANS2ASC]] utility may be used to convert files encoded with ANSI X3.64 terminal escape sequences (e.g. ''*.ans'') into Ctrl-A encoded output and the [[util:ASC2ANS]] utility can be used to perform the opposite operation (useful for editing Ctrl-A encoded files (e.g. ''*.msg'' or ''*.asc'') with an //[[resource:ansi editors|ANSI-BBS screen editor]]//). | The [[util:ANS2ASC]] utility may be used to convert files encoded with ANSI X3.64 terminal escape sequences (e.g. ''*.ans'') into Ctrl-A encoded output and the [[util:ASC2ANS]] utility can be used to perform the opposite operation (useful for editing Ctrl-A encoded files (e.g. ''*.msg'' or ''*.asc'') with an //[[resource:ansi editors|ANSI-BBS screen editor]]//). |
===== Colors ===== | ===== Colors ===== |
| |
The following table is a list of Color Ctrl-A codes and their purpose: | The following table is a list of //Color Control// Ctrl-A codes and their purpose: |
| |
^Color ^Foreground^Background^ | ^Color ^Foreground^Background^ |
|Red | ''R'' | ''1'' | | |Red | ''R'' | ''1'' | |
|Green | ''G'' | ''2'' | | |Green | ''G'' | ''2'' | |
|Yellow | ''Y'' | ''3'' | | |Yellow/Brown | ''Y'' | ''3'' | |
|Blue | ''B'' | ''4'' | | |Blue | ''B'' | ''4'' | |
|Magenta| ''M'' | ''5'' | | |Magenta| ''M'' | ''5'' | |
|Cyan | ''C'' | ''6'' | | |Cyan | ''C'' | ''6'' | |
|White | ''W'' | ''7'' | | |White/Gray | ''W'' | ''7'' | |
| |
===== Attributes ===== | ===== Attributes ===== |
| |
The following table is a list of Attribute Ctrl-A codes, and a brief description of each code's usage: | The following table is a list of //Attribute Control// Ctrl-A codes, and a brief description of each code's usage: |
| |
^Attribute ^ Code ^Description ^ | ^Attribute ^ Code ^Description ^ |
|High | ''H'' |High Intensity (bright) | | |Bright | ''H'' |High Intensity foreground | |
|Blink | ''I'' |Blinking | | |Blink | ''I'' |Blinking (slow), when supported by the terminal | |
|Normal | ''N'' |No Special Attributes (Normal) | | |Bright-Background | ''E'' |High intensity background (so-called iCE colors), when supported by the terminal (new in v3.17c) | |
|Optimized Normal | ''-'' |Only sends sequence if High Intensity, Blinking, or Background attribute is set (or pop attributes if pushed)| | |Blink-Font | ''f'' |Set the //Blink// attribute **only** if a alternate [[config:fonts.ini|Blink-font]] has been activated in the terminal (new in v3.17) | |
|Optimized Normal | ''_'' |Only sends sequence if Blinking or Background attribute is set| | |High-Blink-Font | ''F'' |Set the //Blink// attribute **only** if a alternate [[config:fonts.ini|High-intensity Blink-font]] has been activated in the terminal (new in v3.17) | |
| |Normal | ''N'' |No Special Attributes (Normal, e.g. light-gray) - resets both //High// and //Blink// attributes | |
| |Optimized Normal | ''-'' |Only changes to //normal// if High Intensity, Blinking, or Background attribute is set (or pop attributes if pushed)| |
| |Optimized Normal | ''_'' |Only changes to //normal// if the Blinking or Background attribute is set | |
| |
| ==== High Intensity and Blink ==== |
| The //High Intensity// console attribute behaves as it does with ANSI terminals: that is, once enabled, the current color and any subsequent new colors will be rendered in their "high intensity" (bright) version. To revert to normal/dark colors, a //Normal// (or //Optimized Normal//) Ctrl-A code must be specified. The //Normal// attribute code will reset both the //High Intensity// and the current color - back to the default, "light gray". |
| |
| The //Blink// console attribute behaves similarly: once set, all newly-printed characters will have the blink attribute until a //Normal// attribute code is encountered. |
===== Control ===== | ===== Control ===== |
| |
The following table is a list of Terminal Control Ctrl-A codes, and a brief description of each code's usage: | The following table is a list of //Terminal Control// Ctrl-A codes, and a brief description of each code's usage: |
| |
^Operation ^ Code ^Description ^ | ^ Operation ^ Code ^ Description ^ |
|Pause | ''P'' |Display a Pause (Hit a key) Prompt| | |Pause | ''P'' |Display a Pause (e.g. [Hit a key]) Prompt| |
|Pause Reset | ''Q'' |Reset the line counter for the auto screen-pause| | |Pause Reset | ''Q'' |Reset the line counter for the auto screen-pause function| |
|Delay | '','' |Delay for one tenth of a second| | |Delay | '','' |Delay for one tenth of a second| |
|Delay | '';'' |Delay for one half second| | |Delay | '';'' |Delay for one half second| |
|Delay | ''.'' |Delay for two seconds| | |Delay | ''.'' |Delay for two seconds| |
|Cls | ''L'' |Clear the screen| | |Cls | ''L'' |Clear the screen, clear any existing mouse hot-spots, and home the cursor | |
|Clreol | ''>'' |Clear to end of line (leave cursor in current position)| | |Home | ''''' |Home the cursor (without necessarily clearing the screen, used to be ''`'')| |
|Bckspc | ''<'' |Send a non-destructive backspace character (Ctrl-H) - Cursor Left| | |Hungry-hotspot | ''~'' |Precedes a single-character hungry mouse hot-spot command (CR if next character is a ctrl char or end of string) | |
|CR | ''['' |Send a carriage return character (Ctrl-M) - Cursor to Beginning of Line| | |Strict-hotspot | ''`'' |Precedes a single-character strict mouse hot-spot command (or "Home" if next character is a ctrl char or end of string) | |
|LF | '']'' |Send a line feed character (Ctrl-J) - Cursor Down| | |Clreos | ''J'' |Clear to end of screen (leave cursor in current position)| |
|Push Attr | ''+'' |Save current attributes into attribute LIFO stack| | |Clreol | ''>'' |Clear to end of line (leave cursor in current position)| |
|Pop Attr | ''-'' |Restore attributes from stack (or Optimized Normal, if no attributes saved/pushed)| | |Bckspc | ''<'' |Send a non-destructive backspace character (Ctrl-H) - Cursor Left| |
|Cursor Right| 128-255 |Move cursor to the right (code-127) characters| | |CR | ''['' |Send a carriage return character (Ctrl-M) - Cursor to Beginning of Line| |
| |LF | '']'' |Send a line feed character (Ctrl-J) - Cursor Down| |
| |Cond-Newline | ''/'' |Send a new-line sequence (CRLF) **only** when the cursor is not already in the first column (new in v3.17) | |
| |Cond-Linecont | ''\'' |Send a line-continuation sequence (''[[custom:text.dat]]'' //LongLineContinuationPrefix// line) if terminal < 80 columns | |
| |Cond-Blankline | ''?'' |Send a blank-line sequence **only** when the previously printed line was not blank (new in v3.17) | |
| |Push Attr | ''+'' |Save current attributes into (server-side) attribute LIFO stack| |
| |Pop Attr | ''-'' |Restore attributes from stack (or Optimized Normal, if no attributes saved/pushed)| |
| |SOH | ''A'' |Send an actual Ctrl-A (ASCII 1) character| |
| |SUB | ''z'' |Send an actual Ctrl-Z (ASCII 26) character (note: lowercase 'z' only v3.17c and later) | |
| |EOF | ''Z'' |Premature end-of-file (note: uppercase 'Z' only in v3.17c and later) | |
| |Cursor Right | 128-255 |Move cursor to the right (code-127) characters| |
| |
===== Macros ===== | ===== Macros ===== |
| |
The following table is a list of Macro Ctrl-A codes, and a brief description of each code's usage: | The following table is a list of //Macro// Ctrl-A codes, and a brief description of each code's usage: |
| |
^Macro ^ Code ^Description ^ | ^Macro ^ Code ^Description ^ |
|Date | ''D'' |Display the current system date (in "HH:MM am" format)| | |Date | ''D'' |Display the current system date (in "MM/DD/YY" or "DD/MM/YY" format)| |
|Time | ''T'' |Display the current system time (in "MM/DD/YY" or "DD/MM/YY" format)| | |Time | ''T'' |Display the current system time (in "HH:MM am" or "HH:MM:SS" format)| |
|Ctrl-A | ''A'' |Send an actual Ctrl-A (ASCII 1) character| | |
| |
===== Advanced ===== | ===== Advanced ===== |
| |
The following table is a list of Advanced Ctrl-A codes, and a brief description of each code's usage: | The following table is a list of //Advanced// Ctrl-A codes, and a brief description of each code's usage: |
| |
^Operation^ Code ^Description ^ | ^Operation^ Code ^Description ^ |
|Sync | ''S'' |Synchronize output with remote system| | |Sync | ''S'' |Synchronize node status and output with terminal (i.e. initiates a call to ''nodesync()'')| |
|EOF | ''Z'' |End of displayable text in this file | | |Embed File| ''%%"%%//filename//''| Display contents of //filename// from the Terminal Server's ''[[dir:text]]'' directory| |
|Embed File| ''%%"%%//filename//''| Display contents of //filename// from your ''[[dir:text]]'' directory| | |
| |
===== Security ===== | ===== Security ===== |
| |
Synchronet also supports Ctrl-A codes used to hide text from users | Synchronet also supports //Secure Control// Ctrl-A codes which may be used to hide text from users |
not meeting certain security criteria (i.e.: Security Level or Flags from Flag Set #1). | not meeting certain security criteria (i.e.: Security Level or Flags from Flag Set #1). |
| |
The following table is a list of Security Ctrl-A codes, and a brief description of each code's usage: | The following table is a list of Security Control Ctrl-A codes, and a brief description of each code's usage: |
| |
^Code ^Description^ | ^Code ^Description^ |
| |
===== See Also ===== | ===== See Also ===== |
* [[javascript|@-Codes]] | * [[atcodes|@-Codes]] |
* [[:util:ANS2ASC]] | * [[:util:ANS2ASC]] |
* [[:util:ASC2ANS]] | * [[:util:ASC2ANS]] |
* [[:ref:ANSI]] | * [[:ref:ANSI]] |
* [[javascript|Customization]] | * [[:custom:|Customization]] |
| * [[:resource:ANSI Editors]] |
| |
{{tag>ansi}} | {{tag>ansi}} |
| |