Template:Key press/doc: Difference between revisions

From ThinkServer
Started correcting documentation
m →‎Wikilinks: Corrected Alt key
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__


This is the {{tl|key press}} template primarily designed to illustrate keys and keystrokes on a [[computer keyboard]]. With additional parameters, a single template can even illustrate a combination of multiple ''simultaneous'' keystrokes. A sequence of keystrokes, on the other hand, need to be demonstrated with separate templates.
This is the <code><nowiki>{{key press}}</nowiki></code> template primarily designed to illustrate keys and keystrokes on a [https://en.wikipedia.org/wiki/Keyboard_technology computer keyboard]. With additional parameters, a single template can even illustrate a combination of multiple ''simultaneous'' keystrokes. A sequence of keystrokes, on the other hand, need to be demonstrated with separate templates.


Example
Example
: <nowiki>{{key press|A}}</nowiki> → {{key press|A}}
: <code><nowiki>{{key press|A}}</nowiki></code> → {{key press|A}}


===Keystroke combinations===
===Keystroke combinations===
To illustrate keystroke combinations, just use extra parameters:
To illustrate keystroke combinations, just use extra parameters:
: <nowiki>{{key press|Alt|P}}</nowiki> → {{key press|Alt|P}}
: <code><nowiki>{{key press|Alt|P}}</nowiki></code> → {{key press|Alt|P}}
: <nowiki>{{key press|Ctrl|Alt|Del}}</nowiki> → {{key press|Ctrl|Alt|Del}}
: <code><nowiki>{{key press|Ctrl|Alt|Del}}</nowiki></code> → {{key press|Ctrl|Alt|Del}}


When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional ''chain'' parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table then that might cause too wide items. Then instead manually build the key combination with spaces around the "+" so it can line wrap:
When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional ''chain'' parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table then that might cause too wide items. Then instead manually build the key combination with spaces around the "+" so it can line wrap:
: <nowiki>{{key press|Ctrl}}</nowiki> + <nowiki>{{key press|Alt}}</nowiki> + <nowiki>{{key press|Del}}</nowiki> → {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}
: <code><nowiki>{{key press|Ctrl}}</nowiki></code> + <code><nowiki>{{key press|Alt}}</nowiki></code> + <code><nowiki>{{key press|Del}}</nowiki></code> → {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}
: <nowiki>{{key press|Ctrl|Alt|Del|5=chain=&amp;#32;+&amp;#32;}}</nowiki> → {{key press|Ctrl|Alt|Del|chain=&#32;+&#32;}}
: <code><nowiki>{{key press|Ctrl|Alt|Del|5=chain=&amp;#32;+&amp;#32;}}</nowiki></code> → {{key press|Ctrl|Alt|Del|chain=&#32;+&#32;}}


On the other hand, to illustrate Windows [[Alt code]]s you might want to use separate templates with no intervening punctuation or space. In most Windows systems in North America and Western Europe, for example, the [[plus-minus sign]] (±) can be entered by holding down the Alt key while typing <code>0177</code> (with the [[numeric keypad]]):
On the other hand, to illustrate Windows [https://en.wikipedia.org/wiki/Alt_code Alt code]s you might want to use separate templates with no intervening punctuation or space. In most Windows systems in North America and Western Europe, for example, the [https://en.wikipedia.org/wiki/Plus%E2%80%93minus_sign plus-minus sign] (±) can be entered by holding down the Alt key while typing <code>0177</code> (with the [https://en.wikipedia.org/wiki/Numeric_keypad numeric keypad]):
: {{tc|key press|Alt|0}}{{tlc|key press|1}}{{tlc|key press|7}}{{tlc|key press|7}} → {{key press|Alt|0}}{{key press|1}}{{key press|7}}{{key press|7}}
: <code><nowiki>{{key press|Alt|0}}{{key press|1}}{{key press|7}}{{key press|7}}</nowiki></code> → {{key press|Alt|0}}{{key press|1}}{{key press|7}}{{key press|7}}


An example of a use case where more than 5 might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application:
An example of a use case where more than 5 might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application:
: {{tc|Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}} → {{Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}}
: <code><nowiki>{{Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}}</nowiki></code> → {{Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}}


===Wikilinks===
===Wikilinks===
If there is an article about the key you can [[WP:wikilink|wikilink]] the key's name like any other wiki text. Like this:
If there is an article about the key you can [https://en.wikipedia.org/wiki/Wikipedia:Wikilink wikilink] the key's name like any other wiki text. Like this:
* {{tc|key press|<nowiki>[[Alt key|Alt]]</nowiki>}} → {{key press|[[Alt key|Alt]]}}
* <code><nowiki>{{key press|[[https://en.wikipedia.org/wiki/Alt_key|Alt]]}}</nowiki></code> → {{key press|Alt}}


If you are wikilinking the keys, please ensure that you are piping to the correct page (e.g. <code><nowiki>[[Control key|Ctrl]]</nowiki></code> instead of <code><nowiki>[[Ctrl]]</nowiki></code>, which leads to a [[WP:Disambiguation page|disambiguation page]]).
If you are wikilinking the keys, please ensure that you are piping to the correct page (e.g. <code><nowiki>[[Control key|Ctrl]]</nowiki></code> instead of <code><nowiki>[[Ctrl]]</nowiki></code>, which leads to a [https://en.wikipedia.org/wiki/Wikipedia:Disambiguation_page disambiguation page]).


===Wiki markup characters===
===Wiki markup characters===
Some wiki markup characters, like the [[pipe symbol]], the [[semicolon]] and the [[equals sign]], need to be entered using the {{tlx|!}}, {{tlx|;}} and {{tlx|{{=}}}} templates or as an [[HTML entity]] &amp;#124;, &amp;#59;, &amp;#61; respectively:
Some wiki markup characters, like the [https://en.wikipedia.org/wiki/Pipe_symbol pipe symbol], the [https://en.wikipedia.org/wiki/Semicolon semicolon] and the [https://en.wikipedia.org/wiki/Equals_sign equals sign], need to be entered using the <code><nowiki>{{!}}</nowiki></code>, <code><nowiki>{{;}}</nowiki></code> and <code><nowiki>{{=}}</nowiki></code> templates or as an [https://en.wikipedia.org/wiki/HTML_entity HTML entity] &amp;#124;, &amp;#59;, &amp;#61; respectively:
* {{tc|key press|{{tc|pipe}}}} → {{key press|{{pipe}}}}
* <code><nowiki>{{key press|{{pipe}}}}</nowiki></code> → {{key press|{{pipe}}}}
* {{tc|key press|&amp;#124;}} → {{key press|&#124;}}
* <code><nowiki>{{key press|&amp;#124;}}</nowiki></code> → {{key press|&#124;}}
* {{tc|key press|{{tc|&#59;}}}} → {{key press|{{;}}}}
* <code><nowiki>{{key press|{{&#59;}}}}</nowiki></code> → {{key press|{{;}}}}
* {{tc|key press|&amp;#59;}} →  {{key press|&#59;}}
* <code><nowiki>{{key press|&amp;#59;}}</nowiki></code> →  {{key press|&#59;}}
* {{tc|key press|{{tc|&#61;}}}} → {{key press|{{=}}}}
* <code><nowiki>{{key press|{{&#61;}}}}</nowiki></code> → {{key press|{{=}}}}
* {{tc|key press|&amp;#61;}} →  {{key press|&#61;}}
* <code><nowiki>{{key press|&amp;#61;}}</nowiki></code> →  {{key press|&#61;}}


However, if the characters are marked as wikilinks, they can be entered as such:
However, if the characters are marked as wikilinks, they can be entered as such:
* {{tc|key press|<nowiki>[[&#124;]]</nowiki>}} → {{key press|}}
* <code><nowiki>{{key press|[[&#124;]]}}</nowiki></code> → {{key press|}}
* {{tc|key press|<nowiki>[[;]]</nowiki>}} → {{key press|[[;]]}}
* <code><nowiki>{{key press|[[;]]}}</nowiki></code> → {{key press|[[;]]}}
* {{tc|key press|<nowiki>[[=]]</nowiki>}} → {{key press|[[=]]}}
* <code><nowiki>{{key press|[[=]]}}</nowiki></code> → {{key press|[[=]]}}


Most markup characters also have aliases:
Most markup characters also have aliases:
* {{tc|key press|pipe}} → {{key press|pipe}}
* <code><nowiki>{{key press|pipe}}</nowiki></code> → {{key press|pipe}}
* {{tc|key press|semicolon}} → {{key press|semicolon}}
* <code><nowiki>{{key press|semicolon}}</nowiki></code> → {{key press|semicolon}}
* {{tc|key press|equals}} → {{key press|equals}}
* <code><nowiki>{{key press|equals}}</nowiki></code> → {{key press|equals}}
* {{tc|key press|colon}} → {{key press|colon}}
* <code><nowiki>{{key press|colon}}</nowiki></code> → {{key press|colon}}
* {{tc|key press|asterisk}} → {{key press|asterisk}}
* <code><nowiki>{{key press|asterisk}}</nowiki></code> → {{key press|asterisk}}
* {{tc|key press|hash}} → {{key press|hash}}
* <code><nowiki>{{key press|hash}}</nowiki></code> → {{key press|hash}}


===Key symbols===
===Key symbols===
Some key names have a fitting [[Unicode]] character. This template automatically adds such "icons" to the following key names among others.
Some key names have a fitting [https://en.wikipedia.org/wiki/Unicode Unicode] character. This template automatically adds such "icons" to the following key names among others.
* {{tc|key press|Shift}} → {{key press|Shift}}
* <code><nowiki>{{key press|Shift}}</nowiki></code> → {{key press|Shift}}
* {{tc|key press|Tab}} → {{key press|Tab}}
* <code><nowiki>{{key press|Tab}}</nowiki></code> → {{key press|Tab}}
* {{tc|key press|Enter}} → {{key press|Enter}}
* <code><nowiki>{{key press|Enter}}</nowiki></code> → {{key press|Enter}}
* {{tc|key press|Option}} → {{key press|Option}}
* <code><nowiki>{{key press|Option}}</nowiki></code> → {{key press|Option}}
* {{tc|key press|Opt}} → {{key press|Opt}}
* <code><nowiki>{{key press|Opt}}</nowiki></code> → {{key press|Opt}}
* {{tc|key press|Command}} → {{key press|Command}}
* <code><nowiki>{{key press|Command}}</nowiki></code> → {{key press|Command}}
* {{tc|key press|Cmd}} → {{key press|Cmd}}
* <code><nowiki>{{key press|Cmd}}</nowiki></code> → {{key press|Cmd}}
* {{tc|key press|Caps Lock}} → {{key press|Caps Lock}}
* <code><nowiki>{{key press|Caps Lock}}</nowiki></code> → {{key press|Caps Lock}}
* {{tc|key press|Scroll Lock}} → {{key press|Scroll Lock}}
* <code><nowiki>{{key press|Scroll Lock}}</nowiki></code> → {{key press|Scroll Lock}}
* {{tc|key press|Up}} → {{key press|Up}}
* <code><nowiki>{{key press|Up}}</nowiki></code> → {{key press|Up}}
* {{tc|key press|Down}} → {{key press|Down}}
* <code><nowiki>{{key press|Down}}</nowiki></code> → {{key press|Down}}
* {{tc|key press|Left}} → {{key press|Left}}
* <code><nowiki>{{key press|Left}}</nowiki></code> → {{key press|Left}}
* {{tc|key press|Right}} → {{key press|Right}}
* <code><nowiki>{{key press|Right}}</nowiki></code> → {{key press|Right}}
[[File:AltGr Win Menu Ctrl key.jpg|thumb|200px|Windows key and Menu key]]
There are no characters for the [https://en.wikipedia.org/wiki/Windows_key|Windows key] and [https://en.wikipedia.org/wiki/Menu_key|Menu key]. So this template shows approximate characters for them, namely the {{sc2|SQUARED PLUS}} and {{sc2|STRICTLY EQUIVALENT TO}} from the [https://en.wikipedia.org/wiki/Mathematical_Operators|Mathematical Operators] Unicode block:
[[File:Ctl wndws alt.jpg|thumb|200px|Old-style Windows key]]
* <code><nowiki>{{key press|Win}}</nowiki></code> → {{key press|Win}}
There are no characters for the [[Windows key]] and [[Menu key]]. So this template shows approximate characters for them, namely the {{sc2|SQUARED PLUS}} and {{sc2|STRICTLY EQUIVALENT TO}} from the [[Mathematical Operators]] Unicode block:
* <code><nowiki>{{key press|Menu}}</nowiki></code> → {{key press|Menu}}
* {{tc|key press|Win}} → {{key press|Win}}
* {{tc|key press|Menu}} → {{key press|Menu}}


====Video games====
====Video games====
Line 75: Line 73:
=====Directional input=====
=====Directional input=====
The following should only be used when the input sequence uses something other than the primary input or mixes input between directional devices.
The following should only be used when the input sequence uses something other than the primary input or mixes input between directional devices.
* {{tc|key press|l-down}} → {{key press|l-down}}
* <code><nowiki>{{key press|l-down}}</nowiki></code> → {{key press|l-down}}
* {{tc|key press|c-left}} → {{key press|c-left}}
* <code><nowiki>{{key press|c-left}}</nowiki></code> → {{key press|c-left}}
* {{tc|key press|r-up}} → {{key press|r-up}}
* <code><nowiki>{{key press|r-up}}</nowiki></code> → {{key press|r-up}}


Stick specific diagonals are also supported:
Stick specific diagonals are also supported:
* {{tc|key press|l-nw}} → {{key press|l-nw}}
* <code><nowiki>{{key press|l-nw}}</nowiki></code> → {{key press|l-nw}}
* {{tc|key press|c-se}} → {{key press|c-se}}
* <code><nowiki>{{key press|c-se}}</nowiki></code> → {{key press|c-se}}
* {{tc|key press|r-ne}} → {{key press|r-ne}}
* <code><nowiki>{{key press|r-ne}}</nowiki></code> → {{key press|r-ne}}


=====PlayStation=====
=====PlayStation=====
* {{tc|key press|ex}} → {{key press|ex}}
* <code><nowiki>{{key press|ex}}</nowiki></code> → {{key press|ex}}
* {{tc|key press|circle}} → {{key press|circle}}
* <code><nowiki>{{key press|circle}}</nowiki></code> → {{key press|circle}}
* {{tc|key press|triangle}} → {{key press|triangle}}
* <code><nowiki>{{key press|triangle}}</nowiki></code> → {{key press|triangle}}
* {{tc|key press|square}} → {{key press|square}}
* <code><nowiki>{{key press|square}}</nowiki></code> → {{key press|square}}
{{clear}}
{{clear}}


===TemplateData===
===TemplateData===
{{TemplateDataHeader}}
This is the TemplateData docuementation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
<templatedata>
====TemplateData for Key press====
{
Illustrates keys and keystrokes on a computer keyboard. Keys can include: Ctrl, Alt, Del, Opt, Menu, Left etc. console keys: ex, circle, triangle, square, and left right and center analog sticks: l-down, c-left, r-ne. The names are case insensitive.
"description": "Illustrates keys and keystrokes on a computer keyboard. Keys can include: Ctrl, Alt, Del, Opt, Menu, Left etc. console keys: ex, circle, triangle, square, and left right and center analog sticks: l-down, c-left, r-ne. The names are case insensitive.",
 
"params": {
{| class="wikitable"
"1": {
!scope="col" colspan="2"|Parameter
"label": "First key",
!scope="col"|Description
"description": "First key",
!scope="col"|Type
"type": "string/line",
!scope="col"|Status
"required": true
|-
},
!scope="col"|First key.
"2": {
|<code>1</code>
"label": "Second key",
|First key
"description": "Optional key press in combination as the first.",
|Line
"type": "string/line",
|'''required'''
"required": false
|-
},
!scope="col"|Second key
"3": {
|<code>2</code>
"label": "Third key",
|Optional key press in combination as the first.
"inherits": "2"
|Line
},
|optional
"4": {
|-
"label": "Fourth key",
!scope="col"|Third key
"inherits": "2"
|<code>3</code>
},
|Optional key press in combination as the first.
"5": {
|Line
"label": "Fifth key",
|optional
"inherits": "2"
|-
},
!scope="col"|Fourth key
"6": {
|<code>4</code>
"label": "Sixth key",
|Optional key press in combination as the first.
"inherits": "2"
|Line
},
|optional
"7": {
|-
"label": "Seventh key",
!scope="col"|Fifth key
"inherits": "2"
|<code>5</code>
},
|Optional key press in combination as the first.
"8": {
|Line
"label": "Eighth key",
|optional
"inherits": "2"
|-
},
!scope="col"|Sixth key
"9": {
|<code>6</code>
"label": "Ninth key",
|Optional key press in combination as the first.
"inherits": "2"
|Line
},
|optional
"10": {
|-
"label": "Tenth key",
!scope="col"|Seventh key
"inherits": "2"
|<code>7</code>
},
|Optional key press in combination as the first.
"chain": {
|Line
"label": "Chaining character",
|optional
"description": "Character between chained key presses",
|-
"default": "+",
!scope="col"|Eighth key
"inherits": "2"
|<code>8</code>
},
|Optional key press in combination as the first.
"chain first": {
|Line
"description": "Character between first and second key to press",
|optional
"inherits": "chain"
|-
},
!scope="col"|Ninth key
"chain second": {
|<code>9</code>
"description": "Character between second and third key to press",
|Optional key press in combination as the first.
"inherits": "chain"
|Line
},
|optional
"chain third": {
|-
"description": "Character between third and fourth key to press",
!scope="col"|Tenth key
"inherits": "chain"
|<code>10</code>
},
|Optional key press in combination as the first.
"chain fourth": {
|Line
"description": "Character between fourth and fifth key to press",
|optional
"inherits": "chain"
|-
}
!scope="col"|Chaining character
}
|<code>chain</code>
}
|Character between chained key presses.<br>'''Default'''<br>+
</templatedata>
|Line
|optional
|-
!scope="col"|Chaining character
|<code>10</code>
|Character between first and second key press.<br>'''Default'''<br>+
|Line
|optional
|-
!scope="col"|Chaining character
|<code>10</code>
|Character between second and third key press.<br>'''Default'''<br>+
|Line
|optional
|-
!scope="col"|Chaining character
|<code>10</code>
|Character between third and fourth key press.<br>'''Default'''<br>+
|Line
|optional
|-
!scope="col"|Chaining character
|<code>10</code>
|Character between fourth and fifth key press.<br>'''Default'''<br>+
|Line
|optional
|}


===See also===
===See also===
* {{tlx|Key top}} – produces a similar visual effect, but includes more symbols and does not directly support key combinations (e.g. {{key top|Caps Lock}})
* <code><nowiki>{{Key top}}</nowiki></code> – produces a similar visual effect, but includes more symbols and does not directly support key combinations (e.g. <code><nowiki>{{key top|Caps Lock}}</nowiki></code>).
* {{tlx|Button}} – produces a similar visual effect but without the semantic markup (e.g. {{Button|sample text}}); more for representing interface elements.
* <code><nowiki>{{Button}}</nowiki></code> – produces a similar visual effect but without the semantic markup (e.g. {{Button|sample text}}); more for representing interface elements.
* {{tlx|Playstation key press}} – to simulate gamepad buttons (e.g. {{tlx|Playstation key press|s}})
* <code><nowiki>{{Playstation key press}}</nowiki></code> – to simulate gamepad buttons (e.g. <code><nowiki>{{Playstation key press|s}}</nowiki></code>).
* {{tlx|Kbd}} – to indicate user input (of any kind) without making it look like keys or buttons
* <code><nowiki>{{Kbd}}</nowiki></code> – to indicate user input (of any kind) without making it look like keys or buttons.
 
{{Semantic markup templates}}
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- CATEGORY LINKS BELOW THIS LINE, PLEASE: -->
[[Category:Programming typing-aid templates]]
<!-- [[Category:Graphic templates]] - Don't add this one; this isn't a graphic template, as it's all done in CSS. -->
[[Category:Semantic markup templates]]
[[Category:Software templates]]
[[Category:Computer keys|τ]]
 
[[nl:Sjabloon:Toets]]
[[sl:Predloga:Keypress]]
}}</includeonly>

Latest revision as of 09:27, 29 May 2021


This is the {{key press}} template primarily designed to illustrate keys and keystrokes on a computer keyboard. With additional parameters, a single template can even illustrate a combination of multiple simultaneous keystrokes. A sequence of keystrokes, on the other hand, need to be demonstrated with separate templates.

Example

{{key press|A}}A

Keystroke combinations

To illustrate keystroke combinations, just use extra parameters:

{{key press|Alt|P}}Alt+P
{{key press|Ctrl|Alt|Del}}Ctrl+Alt+Del

When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional chain parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table then that might cause too wide items. Then instead manually build the key combination with spaces around the "+" so it can line wrap:

{{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}Ctrl + Alt + Del
{{key press|Ctrl|Alt|Del|5=chain=&#32;+&#32;}}Ctrl + Alt + Del

On the other hand, to illustrate Windows Alt codes you might want to use separate templates with no intervening punctuation or space. In most Windows systems in North America and Western Europe, for example, the plus-minus sign (±) can be entered by holding down the Alt key while typing 0177 (with the numeric keypad):

{{key press|Alt|0}}{{key press|1}}{{key press|7}}{{key press|7}}Alt+0177

An example of a use case where more than 5 might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application:

{{Key press|Ctrl|Alt|Shift|Win|Menu|fn|L}}Ctrl+Alt+⇧ Shift+⊞ Win+≣ Menu+fn+L

Wikilinks

If there is an article about the key you can wikilink the key's name like any other wiki text. Like this:

  • {{key press|[[https://en.wikipedia.org/wiki/Alt_key|Alt]]}}Alt

If you are wikilinking the keys, please ensure that you are piping to the correct page (e.g. [[Control key|Ctrl]] instead of [[Ctrl]], which leads to a disambiguation page).

Wiki markup characters

Some wiki markup characters, like the pipe symbol, the semicolon and the equals sign, need to be entered using the {{!}}, {{;}} and {{=}} templates or as an HTML entity &#124;, &#59;, &#61; respectively:

  • {{key press|{{pipe}}}}|
  • {{key press|&#124;}}|
  • {{key press|{{;}}}};
  • {{key press|&#59;}};
  • {{key press|{{=}}}}=
  • {{key press|&#61;}}=

However, if the characters are marked as wikilinks, they can be entered as such:

  • {{key press|[[|]]}}
  • {{key press|[[;]]}};
  • {{key press|[[=]]}}=

Most markup characters also have aliases:

  • {{key press|pipe}}|
  • {{key press|semicolon}};
  • {{key press|equals}}=
  • {{key press|colon}}:
  • {{key press|asterisk}}*
  • {{key press|hash}}#

Key symbols

Some key names have a fitting Unicode character. This template automatically adds such "icons" to the following key names among others.

  • {{key press|Shift}}⇧ Shift
  • {{key press|Tab}}Tab ↹
  • {{key press|Enter}}↵ Enter
  • {{key press|Option}}⌥ Option
  • {{key press|Opt}}⌥ Opt
  • {{key press|Command}}⌘ Command
  • {{key press|Cmd}}⌘ Cmd
  • {{key press|Caps Lock}}⇪ Caps Lock
  • {{key press|Scroll Lock}}Scroll Lock
  • {{key press|Up}}
  • {{key press|Down}}
  • {{key press|Left}}
  • {{key press|Right}}

There are no characters for the key and key. So this template shows approximate characters for them, namely the SQUARED PLUS and STRICTLY EQUIVALENT TO from the Operators Unicode block:

  • {{key press|Win}}⊞ Win
  • {{key press|Menu}}≣ Menu

Video games

Video game controllers often have specialized input labels that do not map easily. The following are mappings for various game consoles and input features.

Directional input

The following should only be used when the input sequence uses something other than the primary input or mixes input between directional devices.

  • {{key press|l-down}}L↓
  • {{key press|c-left}}C←
  • {{key press|r-up}}R↑

Stick specific diagonals are also supported:

  • {{key press|l-nw}}L↖
  • {{key press|c-se}}C↘
  • {{key press|r-ne}}R↗
PlayStation
  • {{key press|ex}}×
  • {{key press|circle}}
  • {{key press|triangle}}
  • {{key press|square}}

TemplateData

This is the TemplateData docuementation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Key press

Illustrates keys and keystrokes on a computer keyboard. Keys can include: Ctrl, Alt, Del, Opt, Menu, Left etc. console keys: ex, circle, triangle, square, and left right and center analog sticks: l-down, c-left, r-ne. The names are case insensitive.

Parameter Description Type Status
First key. 1 First key Line required
Second key 2 Optional key press in combination as the first. Line optional
Third key 3 Optional key press in combination as the first. Line optional
Fourth key 4 Optional key press in combination as the first. Line optional
Fifth key 5 Optional key press in combination as the first. Line optional
Sixth key 6 Optional key press in combination as the first. Line optional
Seventh key 7 Optional key press in combination as the first. Line optional
Eighth key 8 Optional key press in combination as the first. Line optional
Ninth key 9 Optional key press in combination as the first. Line optional
Tenth key 10 Optional key press in combination as the first. Line optional
Chaining character chain Character between chained key presses.
Default
+
Line optional
Chaining character 10 Character between first and second key press.
Default
+
Line optional
Chaining character 10 Character between second and third key press.
Default
+
Line optional
Chaining character 10 Character between third and fourth key press.
Default
+
Line optional
Chaining character 10 Character between fourth and fifth key press.
Default
+
Line optional

See also

  • {{Key top}} – produces a similar visual effect, but includes more symbols and does not directly support key combinations (e.g. {{key top|Caps Lock}}).
  • {{Button}} – produces a similar visual effect but without the semantic markup (e.g. sample text); more for representing interface elements.
  • {{Playstation key press}} – to simulate gamepad buttons (e.g. {{Playstation key press|s}}).
  • {{Kbd}} – to indicate user input (of any kind) without making it look like keys or buttons.