Template:Key top/doc

From Fōrmulæ wiki
Jump to: navigation, search

{{#ifeq:key top/doc |doc

    | 

{{#ifeq:show |show

         | Template:Mbox
        }}{{#if: |
         |   {{#ifexist:Template:Key top/doc
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

Usage

This template renders a key top as found on typewriters and computer keyboards including a standardized or common symbol if available, e.g. from ISO/IEC 9995-7 Keys for which there is an associated Wikipedia article are rendered with a hyperlink. Unlike {{[[{{#if:|{{{SISTER}}}Template|Template}}:key press|key press]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}, this template is not intended to be used for combinations of multiple keys, i.e. “keyboard shortcuts”. It shall be used in descriptions of the physical keys and their functions.

The first, mandatory parameter holds the “natural” key name which is used to select a symbol and link. Its contents is usually also output unchanged next to the symbol unless the second parameter is set to an explicit label, which most often will be blank to suppress the label. The third, also optional parameter, is a binary switch that toggles alternate representations of a very limited selection of symbols: Template:Key top vs. Template:Key top, Template:Key top vs. Template:Key top vs. Template:Key top, Template:Key top vs. Template:Key top, Template:Key top vs. Template:Key top and Template:Key top vs. Template:Key top.

Examples

{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:return|return| |return | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:RETURN|RETURN| |RETURN | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Enter|Enter| |Enter | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:Enter|Enter| |Enter | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:|| | | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:true|true| |true | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:narrow|narrow| |narrow | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:hollow|hollow| |hollow | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:thin|thin| |thin | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:|| | | }}{{#ifeq:thick|thick| |thick | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Return|Return| |Return | }}{{#ifeq:Return|Return| |Return | }}{{#ifeq:narrow|narrow| |narrow | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Ctrl|Ctrl| |Ctrl | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Ctrl|Ctrl| |Ctrl | }}{{#ifeq:3=true|3=true| |3=true | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Alt|Alt| |Alt | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Option|Option| |Option | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Option|Option| |Option | }}{{#ifeq:Alt|Alt| |Alt | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Windows|Windows| |Windows | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Command|Command| |Command | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Meta|Meta| |Meta | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Super|Super| |Super | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Windows|Windows| |Windows | }}{{#ifeq:3=true|3=true| |3=true | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top
{{#if:|* }}{{{{#if:key top|key top| tlc|...}}{{#ifeq:Super|Super| |Super | }}{{#ifeq:Windows|Windows| |Windows | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}Template:Key top

TemplateData

{{#if:|{{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee the monthly error report for this template.|This is the {{#if:|TemplateData|TemplateData}} documentation for this template used by VisualEditor and other tools; {{#ifeq:{{safesubst:#switch: yes

|no
|n
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee the monthly error report for this template.}}

TemplateData for Key top/doc

{{#ifeq:Key top/doc|sandbox||

}} <templatedata> { "params": { "1": {"description": "The standard or common name of the key.", "label": "name", "type": "line", "example": "Shift", "required": true}, "2": {"description": "Label for the key if different from the name, leave empty to suppress label.", "label": "label", "type": "line", "example": "Level 2 Select", "required": false}, "3": {"description": "Switch for certain alternate symbols (return, control, insert, stop, record)", "label": "alternate symbol", "type": "boolean", "example": "true", "required": false} }, "description": "Display symbolic key tops as seen on computer keyboards, phones and typewriters." } </templatedata>

See also

  • {{[[{{#if:|{{{SISTER}}}Template|Template}}:Key press|Key press]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} – produces a similar visual effect, but includes fewer symbols while directly supporting combinations (e.g. Ctrl+x)
  • {{[[{{#if:|{{{SISTER}}}Template|Template}}:Button|Button]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} – produces a similar visual effect but without the semantic markup (e.g. sample text); more for representing interface elements.
  • {{[[{{#if:|{{{SISTER}}}Template|Template}}:Playstation key press|Playstation key press]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} – to simulate gamepad buttons (e.g. {{[[{{#if:|{{{SISTER}}}Template|Template}}:Playstation key press|Playstation key press]]{{#if:s||s}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}})
  • {{[[{{#if:|{{{SISTER}}}Template|Template}}:Kbd|Kbd]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} – to indicate user input (of any kind) without making it look like keys or buttons