Tab key

From English Wikipedia @ Freddythechick

This is the current revision of this page, as edited by 149.75.194.155 (talk) at 02:47, 1 October 2024 (→‎Modern usage: Replaced hyperlink). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Tab key (top left) on a standard Windows keyboard

The tab key Tab ↹ (abbreviation of tabulator key[1] or tabular key)[2] on a keyboard is used to advance the cursor to the next tab stop.

History

The tab rack from a Flexowriter model 2201. On this machine, the tab-rack is removable for easy reconfiguration.

The word tab derives from the word tabulate, which means "to arrange data in a tabular, or table, form." When a person wanted to type a table (of numbers or text) on a typewriter, there was a lot of time-consuming and repetitive use of the space bar and backspace key. To simplify this, a horizontal bar was placed in the mechanism called the tabulator rack. Pressing the tab key would advance the carriage to the next tabulator stop. The original tabulator stops were adjustable clips that could be arranged by the user on the tabulator rack. Fredric Hillard filed a patent application for such a mechanism in 1900.[3]

The tab mechanism came into its own as a rapid and consistent way of uniformly indenting the first line of each paragraph. Often a first tab stop at 5 or 6 characters was used for this, far larger than the indentation used when typesetting. For numeric data, however, the logical place for the tab stop is the location of the least significant digit. Tabbing to this location and then pressing the backspace key to back up to the position of the first digit is practical but slow. Various schemes for numeric tabs were proposed. For example, in 1903, Harry Dukes and William Clayton filed for a patent on a tab mechanism with multiple tab keys numbered 1, 10, 100, etc. Pressing 1 was a simple tab. Pressing 10 advanced to the space before the tab, pressing 100 advanced to the position 2 spaces before the tab.[4]

Initially tab stops were set by adding and removing clips from the tab rack, but Edward Hess working for the Royal Typewriter Company filed for a patent in 1904 covering a system where the tab stops were permanently mounted on the tab bar. To set or reset a tab for a particular column, the tab stop for that column was simply rotated in or out of engagement.[5] In 1940, James Koca filed for a patent on a mechanism allowing the tab stops for each column to be set and cleared from the keyboard, eliminating the need for the typist to bend over the back of the machine to directly manipulate the tab rack.[6] These keys, if present, are typically labeled tab set and tab clear.

Modern usage

In word processing and text editing, the Tab key will move the insertion point to the next tab stop in a table, insert the ASCII tab character, or insert multiple space characters (depending on the program used).

When filling out a computerized form, pressing Tab will sometimes move the cursor to the next field (and Shift-Tab will move the cursor to the previous field), eliminating the need to use a mouse to click in an adjacent field.

In many graphical applications, especially on Windows, the Tab key will move the focus to every control or widget such as buttons so that the user interface can be used without a mouse at all (this was part of the IBM Common User Access design). On macOS, this is an option called "Full Keyboard Access".

A feature called tab completion can be used to complete a partially typed piece of text. For example, in some command-line interfaces, you may type the first few characters of a command or file-name, then press Tab. If there is no ambiguity about your intent, the rest of the characters will appear automatically. On some systems, even if your input is ambiguous, tab completion may give you a list of possible options to select from. Tab completion is more common on Linux, Unix, and Unix-like systems than Windows.

In PC video games, the Tab key is very often used to show scores in multiplayer games. For single player games it is also used to show the in-game world map or the player's inventory, as well as other useful information.

In software engineering, when developing computer programs or storing and manipulating data in files, the Tab character is often used for indentation purposes to help guide the flow of reading and add semantic structure to the code or data. Some programmers and programming languages prefer the usage of multiple whitespace characters instead for that purpose. Because of this, many text editors have an option that makes the tab key insert the number of whitespace characters that a tab character is set to be equivalent to (by default mostly four).

Tab characters

The most known and common tab is a horizontal tabulation (HT) or character tabulation, which in ASCII has the decimal character code of 9, and may be referred to as Ctrl+I or ^I. In C and many other programming languages the escape sequence <syntaxhighlight lang="text" class="" style="" inline="1">\t</syntaxhighlight> can be used to put this character into a string literal. The horizontal tab is usually inserted when the Tab key on a standard keyboard is pressed.

A vertical tabulation (VT) also exists and has ASCII decimal character code 11 (Ctrl+K or ^K), escape character <syntaxhighlight lang="text" class="" style="" inline="1">\v</syntaxhighlight>.

In EBCDIC the code for HT is 5. VT is 11 (coincidentally the same as in ASCII).

Originally, printer mechanisms used mechanical tab stops to indicate where the tabs went. This was done horizontally with movable metal prongs in a row, and vertically with a loop of mylar or other tape the length of a page with holes punched in it to indicate the tab stops. These were manually set to match the pre-printed forms that were loaded into the printer. In practice, settable tab stops were rather quickly replaced with fixed tab stops, de facto standardized at every multiple of eight characters horizontally, and every six lines vertically. A printing program could send zero or more tabs to get to the closest tab stop above and left of where it wanted to print, then send line feeds and spaces to get to the final location. Tab characters simply became a form of data compression.

Despite the fact that five characters were the typical paragraph indentation on typewriters at that time, the horizontal tab size of eight evolved because as a power of two it was easier to calculate with the limited digital electronics available.[citation needed] Using this size tab to indent code results in much white space on the left, so most text editors for code, such as IDEs, allow the size of the tab to be changed, and some (in particular on Windows) default to four instead of eight. Disagreements between programmers about what size tabs are correct, and whether to use tabs at all, are common.[7] Modern text editors usually have the Tab key insert the user-defined indentation and may use heuristics to adapt this behavior to existing files.

ISO 6429 includes the codes 136 (Horizontal Tabulation Set), 137 (Horizontal Tabulation with Justification) and 138 (Vertical Tabulation Set) that were intended to allow the program to set and clear tab stops.[dubiousdiscuss] This is rarely used or supported.

Tab-separated values

Tab-separated values (TSV) are used for exporting and importing database or spreadsheet field values. Text divided into fields delimited by tabs can often be pasted into a word processor and formatted into a table with a single command. For example, in Microsoft Word 2010, Insert > Table > Convert Text to Table... is the necessary command, producing a dialog where the user selects further details.

The TSV convention for exporting data may be compared to the alternative comma-separated values (CSV) convention (that may be using semicolons instead of commas), and both are easily converted into each other.

Gopher menus use tab-separated values to indicate selectors.

TSV has also been cited in a modern approach to solving the programming debate regarding the use of tabs and spaces for code alignment called elastic tabstops.[8] This idea uses a scheme called tab-separated columns (TSC) rather than the similar tab-separated values (TSV).

HTML

In HTML the horizontal tab is coded using <syntaxhighlight lang="text" class="" style="" inline="1"> </syntaxhighlight> or <syntaxhighlight lang="text" class="" style="" inline="1"> </syntaxhighlight>[9][10] but as with all whitespace characters in HTML, this will be displayed as a single space except inside <pre>, <code> tags (or other elements with CSS attribute <syntaxhighlight lang="text" class="" style="" inline="1">white-space</syntaxhighlight> set to <syntaxhighlight lang="text" class="" style="" inline="1">pre</syntaxhighlight>).

Here is an example:

HTML

<syntaxhighlight lang="html"> This line begins with a single tab. Here are some more tab characters ! T.......T.......T.......T.......T.......T.......T.......T </syntaxhighlight>

Inside <pre>
	This line begins with a single tab.
Here	are	some	more	tab	characters	!
T.......T.......T.......T.......T.......T.......T.......T
Outside <pre>

This line begins with a single tab. Here are some more tab characters ! T.......T.......T.......T.......T.......T.......T.......T

Notice that the tab at the start of a line is removed outside <pre>, the eight-character spacing, and how a tab stop is skipped if there are more than eight characters since last one.

CSS3 defines <syntaxhighlight lang="text" class="" style="" inline="1">tab-size</syntaxhighlight> property, which adjusts the number of spaces for the tab character from the default of eight.[11] The latest version of WebKit supports the <syntaxhighlight lang="text" class="" style="" inline="1">tab-size</syntaxhighlight> property. The Opera web browser supports the <syntaxhighlight lang="text" class="" style="" inline="1">-o-tab-size</syntaxhighlight> CSS property, the Firefox web browser supports the <syntaxhighlight lang="text" class="" style="" inline="1">-moz-tab-size</syntaxhighlight> CSS property with the same meaning.[12]

The vertical tab is <syntaxhighlight lang="text" class="" style="" inline="1">&#xB;</syntaxhighlight> but is not allowed in SGML[citation needed]; this includes XML 1.0[13] and HTML.

Unicode

The Unicode code points for the (horizontal) tab character, and the more rarely used vertical tab character are copied from ASCII:[14]

  • U+0009 <control-0009> (CHARACTER TABULATION, horizontal tabulation (HT), tab)
  • U+000B <control-000B> (LINE TABULATION, vertical tabulation (VT))

The tab characters can be graphically represented by special symbols:

  • U+2409 SYMBOL FOR HORIZONTAL TABULATION
  • U+240B SYMBOL FOR VERTICAL TABULATION

Unicode also has characters for the symbols to represent or be printed on the tab key:[15]

  • U+21B9 LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR (tab with shift tab)
  • U+21C6 LEFTWARDS ARROW OVER RIGHTWARDS ARROW
  • U+21E4 LEFTWARDS ARROW TO BAR (leftward tab)
  • U+21E5 RIGHTWARDS ARROW TO BAR (rightward tab)

Unicode provides additional characters for tab symbols with triangle-headed arrow:[16]

  • U+2B70 LEFTWARDS TRIANGLE-HEADED ARROW TO BAR (left tab)
  • U+2B71 UPWARDS TRIANGLE-HEADED ARROW TO BAR (up tab)
  • U+2B72 RIGHTWARDS TRIANGLE-HEADED ARROW TO BAR (right tab)
  • U+2B73 DOWNWARDS TRIANGLE-HEADED ARROW TO BAR (down tab)
  • U+2B7E HORIZONTAL TAB KEY
  • U+2B7F ⭿ VERTICAL TAB KEY

See also

References

  1. ^ "Underwood Portable Typewriter Gallery". Archived from the original on 2011-02-22. Retrieved 2011-04-09.
  2. ^ "Instructions for Using the Underwood Typewriter" (PDF). Retrieved 2011-04-09.
  3. ^ Fredric W. Hillard, Type-writing machine, U.S. patent 720,520, granted Feb. 10, 1903.
  4. ^ Harry S. Dukes and William H. Clayton, Tabulating mechanism for type-writing machines, U.S. patent 908,221, granted Dec. 29, 1908.
  5. ^ Edward B. Hess, Writing Machine, U.S. patent 931,305, granted Aug. 17. 1909.
  6. ^ James F. Koca, Typewriter stop mechanism, U.S. patent 2,358,517, granted Sep. 19, 1944.
  7. ^ "Tabs versus Spaces". www.jwz.org. Retrieved 2020-06-02.
  8. ^ Gravgaard, Nick. "Elastic tabstops - a better way to indent and align code". nickgravgaard.com. Retrieved 23 March 2018.
  9. ^ See Character encodings in HTML#HTML character references
  10. ^ "Character Entity Reference Chart". dev.w3.org. Retrieved 23 March 2018.
  11. ^ "CSS 3 tab-size property W3 specification".
  12. ^ "CSS tab-size property on Mozilla Developer Network". 21 February 2023.
  13. ^ "Extensible Markup Language (XML) 1.0" (5th ed.). W3C. 26 November 2008. sec. "Charsets".
  14. ^ "C0 Controls and Basic Latin" (PDF). Retrieved 2013-12-13.
  15. ^ "Arrows – Unicode" (PDF). Retrieved 2013-12-13.
  16. ^ "Miscellaneous Symbols and Arrows – Unicode" (PDF). Retrieved 2023-08-31.
Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PrtScn/
SysRq
Scroll
Lock
Pause/
Break
<imagemap>

File:KB United States-NoAltGr.svg|450px desc none

  1. # Row are 60 pixel tall in reference to the unsized original # rect left top right bottom [[link]] #
  2. Top row shift

rect 0 0 60 30 Tilde rect 60 0 120 30 Exclamation mark rect 120 0 180 30 At sign rect 180 0 240 30 Number sign rect 240 0 300 30 Dollar sign rect 300 0 360 30 Percent sign rect 360 0 420 30 Caret rect 420 0 480 30 Ampersand rect 480 0 540 30 Asterisk rect 540 0 600 30 Parenthesis rect 600 0 660 30 Parenthesis rect 660 0 720 30 Underscore rect 720 0 780 30 Plus sign rect 780 0 900 30 Backspace

  1. Top row

rect 0 0 60 60 backtick rect 60 0 120 60 1 (number) rect 120 0 180 60 2 (number) rect 180 0 240 60 3 (number) rect 240 0 300 60 4 (number) rect 300 0 360 60 5 (number) rect 360 0 420 60 6 (number) rect 420 0 480 60 7 (number) rect 480 0 540 60 8 (number) rect 540 0 600 60 9 (number) rect 600 0 660 60 0 rect 660 0 720 60 Hyphen-minus rect 720 0 780 60 Equals sign rect 780 0 900 60 Backspace

  1. Second row shift

rect 0 61 90 90 Tab key rect 90 61 150 90 Q rect 150 61 210 90 W rect 210 61 270 90 E rect 270 61 330 90 R rect 330 61 390 90 T rect 390 61 450 90 Y rect 450 61 510 90 U rect 510 61 570 90 I rect 570 61 630 90 O rect 630 61 690 90 P rect 690 61 750 90 Curly bracket rect 750 61 810 90 Curly bracket rect 810 61 900 90 Vertical bar

  1. Second row

rect 0 61 90 120 Tab key rect 90 61 150 120 q rect 150 61 210 120 w rect 210 61 270 120 e rect 270 61 330 120 r rect 330 61 390 120 t rect 390 61 450 120 y rect 450 61 510 120 u rect 510 61 570 120 i rect 570 61 630 120 o rect 630 61 690 120 p rect 690 61 750 120 Square bracket rect 750 61 810 120 Square bracket rect 810 61 900 120 Backslash

  1. Third row shift

rect 0 121 105 150 Caps lock rect 105 121 165 150 A rect 165 121 225 150 S rect 225 121 285 150 D rect 285 121 345 150 F rect 345 121 405 150 G rect 405 121 465 150 H rect 465 121 525 150 J rect 525 121 585 150 K rect 585 121 645 150 L rect 645 121 705 150 Colon (punctuation) rect 705 121 765 150 Quotation mark rect 765 121 900 150 Enter key

  1. Third row

rect 0 121 105 180 Caps lock rect 105 121 165 180 a rect 165 121 225 180 s rect 225 121 285 180 d rect 285 121 345 180 f rect 345 121 405 180 g rect 405 121 465 180 h rect 465 121 525 180 j rect 525 121 585 180 k rect 585 121 645 180 l rect 645 121 705 180 Semicolon rect 705 121 765 180 Apostrophe rect 765 121 900 180 Enter key

  1. Fourth row shift

rect 0 181 135 210 Shift key rect 135 181 195 210 Z rect 195 181 255 210 X rect 255 181 315 210 C rect 315 181 375 210 V rect 375 181 435 210 B rect 435 181 495 210 N rect 495 181 555 210 M rect 555 181 615 210 Bracket rect 615 181 675 210 Bracket rect 675 181 735 210 Question mark rect 735 181 900 210 Shift key

  1. Fourth row

rect 0 181 135 240 Shift key rect 135 181 195 240 z rect 195 181 255 240 x rect 255 181 315 240 c rect 315 181 375 240 v rect 375 181 435 240 b rect 435 181 495 240 n rect 495 181 555 240 m rect 555 181 615 240 Comma (punctuation) rect 615 181 675 240 Full stop rect 675 181 735 240 Slash (punctuation) rect 735 181 900 240 Shift key

  1. Bottom row

rect 0 241 90 300 Control key rect 90 241 150 300 Windows key rect 150 241 240 300 Alt key rect 240 241 600 300 Space bar rect 600 241 690 300 Alt key rect 690 241 750 300 Windows key rect 750 241 810 300 Menu key rect 810 241 900 300 Control key

</imagemap>

Insert Home PgUp Num
Lock
Delete End PgDn 7 8 9 +
4 5 6
1 2 3 Enter
   0
   Ins
 . 
Del