Difference between revisions of "Template:Key press/doc"
m (→Keystroke combinations) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The template {{ | + | The template {{tlg|key press}} is 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. |
== Usage == | == Usage == | ||
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|A}} produces {{key press|A}} |
== Keystroke combinations == | == Keystroke combinations == | ||
To illustrate keystroke combinations, just use extra parameters: | To illustrate keystroke combinations, just use extra parameters: | ||
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Alt|P}} produces {{key press|Alt|P}} |
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Ctrl|Alt|Del}} produces {{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 that might cause items to be too wide. 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 that might cause items to be too wide. Instead manually build the key combination with spaces around the “+” so it can line wrap: | ||
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Ctrl}} + {{tlg|code=yes|nolink=yes|key press|Alt}} + {{tlg|code=yes|nolink=yes|key press|Del}} produces {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}} |
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Ctrl|Alt|Del|5{{=}}chain= + }} produces {{key press|Ctrl|Alt|Del|chain= + }} |
− | To illustrate sequences where all keys do not need to be pressed simultaneously, the plus signs can be omitted by setting {{para|chain}}. For example, in most Windows systems in North America and Western Europe, Alt codes can be used to insert the plus-minus sign (±) by holding down the {{key press|Alt}} key while typing | + | To illustrate sequences where all keys do not need to be pressed simultaneously, the plus signs can be omitted by setting {{para|chain}}. For example, in most Windows systems in North America and Western Europe, Alt codes can be used to insert the plus-minus sign (±) by holding down the {{key press|Alt}} key while typing {{code|0177}} with the numeric keypad: |
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Alt|0}}{{tlg|code=yes|nolink=yes|key press|1|7|7|chain{{=}}}} produces {{key press|Alt|0}}{{key press|1|7|7|chain=}} |
An example of a use case where more than five 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 five might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application: | ||
− | : {{ | + | : {{tlg|code=yes|nolink=yes|key press|Ctrl|Alt|Shift|Win|Menu|fn|L}} produces {{key press|Ctrl|Alt|Shift|Win|Menu|fn|L}} |
== 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 {{ | + | Some wiki markup characters, like the pipe symbol, the semicolon and the equals sign, need to be entered using the {{tlg|code=yes|nolink=yes|!}}, {{tlg|code=yes|nolink=yes|;}}, and {{tlg|code=yes|{{=}}}} templates or as an HTML entity {{code||}}, {{code|&#59;}}, {{code|&#61}}; respectively: |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press||}} produces {{key press||}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|{{tlg|nolink=yes|;}}}} produces {{key press|{{;}}}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|&#59;}} produces {{key press|;}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|{{tlg|nolink=yes|=}}}} produces {{key press|{{=}}}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|=}} produces {{key press|=}} |
Most markup characters also have aliases: | Most markup characters also have aliases: | ||
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|pipe}} produces {{key press|pipe}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|semicolon}} produces {{key press|semicolon}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|equals}} produces {{key press|equals}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|colon}} produces {{key press|colon}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|asterisk}} produces {{key press|asterisk}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|hash}} produces {{key press|hash}} |
=== Key symbols === | === Key symbols === | ||
Some key names have a fitting Unicode character. This template automatically adds icons to the following key names among others. | Some key names have a fitting Unicode character. This template automatically adds icons to the following key names among others. | ||
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Shift}} produces {{key press|Shift}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Tab}} produces {{key press|Tab}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Enter}} produces {{key press|Enter}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Option}} produces {{key press|Option}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Opt}} produces {{key press|Opt}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Command}} produces {{key press|Command}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Cmd}} produces {{key press|Cmd}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Caps Lock}} produces {{key press|Caps Lock}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Up}} produces {{key press|Up}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Down}} produces {{key press|Down}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Left}} produces {{key press|Left}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Right}} produces {{key press|Right}} |
There are no characters for the Windows key and Menu key. So this template shows approximate characters for them, namely the “squared plus” and “strictly equivalent to” signs from the mathematical operators Unicode block: | There are no characters for the Windows key and Menu key. So this template shows approximate characters for them, namely the “squared plus” and “strictly equivalent to” signs from the mathematical operators Unicode block: | ||
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Win}} produces {{key press|Win}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|Menu}} produces {{key press|Menu}} |
== 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. | ||
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|l-down}} produces {{key press|l-down}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|r-left}} produces {{key press|r-left}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|r-up}} produces {{key press|r-up}} |
Stick specific diagonals are also supported: | Stick specific diagonals are also supported: | ||
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|l-nw}} produces {{key press|l-nw}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|l-se}} produces {{key press|l-se}} |
− | * {{ | + | * {{tlg|code=yes|nolink=yes|key press|r-ne}} produces {{key press|r-ne}} |
== See also == | == See also == | ||
− | * {{ | + | * {{tlg|summertimesaga button}} – produces a visual effect for ''Summertime Saga'' interface elements. |
− | * {{ | + | * {{tlg|kbd}} – indicates user input (of any kind) without making it look like keys or buttons. |
[[Category:Templates]][[Category:Semantic markup templates]][[Category:Templates documentation]] | [[Category:Templates]][[Category:Semantic markup templates]][[Category:Templates documentation]] |
Latest revision as of 18:42, 21 July 2020
The template {{key press}} is 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.
Contents
Usage
{{key press|A}}
produces A
Keystroke combinations
To illustrate keystroke combinations, just use extra parameters:
{{key press|Alt|P}}
produces Alt+P{{key press|Ctrl|Alt|Del}}
produces 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 that might cause items to be too wide. Instead manually build the key combination with spaces around the “+” so it can line wrap:
{{key press|Ctrl}}
+{{key press|Alt}}
+{{key press|Del}}
produces Ctrl + Alt + Del{{key press|Ctrl|Alt|Del}}
produces Ctrl + Alt + Del
To illustrate sequences where all keys do not need to be pressed simultaneously, the plus signs can be omitted by setting |chain=
. For example, in most Windows systems in North America and Western Europe, Alt codes can be used to insert the plus-minus sign (±) by holding down the Alt key while typing 0177
with the numeric keypad:
{{key press|Alt|0}}
{{key press|1|7|7|chain=}}
produces Alt+0177
An example of a use case where more than five 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}}
produces Ctrl+Alt+⇧ Shift+⊞ Win+≣ Menu+fn+L
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 |
, &#59;
, &#61
; respectively:
{{key press||}}
produces |{{key press|{{;}}}}
produces ;{{key press|;}}
produces ;{{key press|{{=}}}}
produces ={{key press|=}}
produces =
Most markup characters also have aliases:
{{key press|pipe}}
produces |{{key press|semicolon}}
produces ;{{key press|equals}}
produces ={{key press|colon}}
produces :{{key press|asterisk}}
produces *{{key press|hash}}
produces #
Key symbols
Some key names have a fitting Unicode character. This template automatically adds icons to the following key names among others.
{{key press|Shift}}
produces ⇧ Shift{{key press|Tab}}
produces Tab ↹{{key press|Enter}}
produces ↵ Enter{{key press|Option}}
produces ⌥ Option{{key press|Opt}}
produces ⌥ Opt{{key press|Command}}
produces ⌘ Command{{key press|Cmd}}
produces ⌘ Cmd{{key press|Caps Lock}}
produces ⇪ Caps Lock{{key press|Up}}
produces ↑{{key press|Down}}
produces ↓{{key press|Left}}
produces ←{{key press|Right}}
produces →
There are no characters for the Windows key and Menu key. So this template shows approximate characters for them, namely the “squared plus” and “strictly equivalent to” signs from the mathematical operators Unicode block:
{{key press|Win}}
produces ⊞ Win{{key press|Menu}}
produces ≣ Menu
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}}
produces L↓{{key press|r-left}}
produces R←{{key press|r-up}}
produces R↑
Stick specific diagonals are also supported:
{{key press|l-nw}}
produces L↖{{key press|l-se}}
produces L↘{{key press|r-ne}}
produces R↗
See also
- {{summertimesaga button}} – produces a visual effect for Summertime Saga interface elements.
- {{kbd}} – indicates user input (of any kind) without making it look like keys or buttons.