Difference between revisions of "Template:Key press"
Jump to navigation
Jump to search
m |
(Added to documentation: Some code that can be copied into articles. WIP, needs more keys added.) |
||
Line 1: | Line 1: | ||
− | <includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em;white-space:nowrap;font-family:sans-serif>{{{key|{{{1|=}}}}}}</kbd></includeonly><noinclude>A simple template that makes it easier to see that a keyboard key is involved. | + | <includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em;white-space:nowrap;font-family:sans-serif>{{{key|{{{1|=}}}}}}</kbd></includeonly><noinclude><!-- Do not put any white space, including new line, between the end tag of includeonly and start tag of noinclude, else pages will break. |
+ | -->A simple template that makes it easier to see that a keyboard key is involved. | ||
==Usage== | ==Usage== | ||
Line 8: | Line 9: | ||
* The <var>key</var> and <var>border</var> parameters can be reversed, but then their names need to be specified: <code><nowiki>{{</nowiki>Key press<nowiki>|border=inset|key=F4}}</nowiki></code> will become {{Key press|border=inset|key=F4}} | * The <var>key</var> and <var>border</var> parameters can be reversed, but then their names need to be specified: <code><nowiki>{{</nowiki>Key press<nowiki>|border=inset|key=F4}}</nowiki></code> will become {{Key press|border=inset|key=F4}} | ||
* Forgetting to specify a key will default to the equals sign: <code><nowiki>{{</nowiki>Key press<nowiki>}}</nowiki></code> becomes {{Key press }}. | * Forgetting to specify a key will default to the equals sign: <code><nowiki>{{</nowiki>Key press<nowiki>}}</nowiki></code> becomes {{Key press }}. | ||
+ | |||
+ | ==Common keys== | ||
+ | For ease of use and consistency throughout pages, the code for some common multi-letter keys is provided here, ready to be copied and pasted into articles. Symbols rely on UTF-8 support by the browser and a font that contains the glyph, so for best compatibility, the text-only version of the code can be recommended for use in most articles. Not every key has a corresponding symbol. | ||
+ | {| class="wikitable sortable" style="margin-left:auto; margin-right:auto" | ||
+ | |+Often-used keys | ||
+ | ! scope="col"|Key | ||
+ | ! scope="col"|Text | ||
+ | ! scope="col"|Symbol | ||
+ | ! scope="col"|Symbol with text | ||
+ | ! scope="col"|Text with symbol | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Shift | ||
+ | | | ||
+ | ;{{Key press|Shift}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⇧}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⇧}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&uArr;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⇧ Shift}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⇧ Shift}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679; Shift}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&uArr; Shift}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Shift ⇧}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift ⇧}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &#8679;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &uArr;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Control | ||
+ | | | ||
+ | ;{{Key press|Ctrl}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|^}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|^}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|^ Ctrl}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|^ Ctrl}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Ctrl ^}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl ^}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Command | ||
+ | | | ||
+ | ;{{Key press|Command}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌘}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌘}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌘ Command}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌘ Command}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984; Command}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Command ⌘}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command ⌘}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command &#8984;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Option | ||
+ | | | ||
+ | ;{{Key press|Option}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌥}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌥}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌥ Option}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌥ Option}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997; Option}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Option ⌥}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option ⌥}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option &#8997;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Alt | ||
+ | | | ||
+ | ;{{Key press|Alt}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Alt}}</nowiki></code> | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Alt Graph | ||
+ | | | ||
+ | ;{{Key press|AltGr}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|AltGr}}</nowiki></code> | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Space | ||
+ | | | ||
+ | ;{{Key press|Space}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⎵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⎵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⎵ Space}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⎵ Space}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141; Space}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Space ⎵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space ⎵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space &#9141;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Enter | ||
+ | | | ||
+ | ;{{Key press|Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|↵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|↵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&crarr;}}</nowiki></code> | ||
+ | ;{{Key press|⌤}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌤}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|↵ Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|↵ Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629; Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&crarr; Enter}}</nowiki></code> | ||
+ | ;{{Key press|⌤ Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌤ Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996; Enter}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Enter ↵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter ↵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8629;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &crarr;}}</nowiki></code> | ||
+ | ;{{Key press|Enter ⌤}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter ⌤}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8996;}}</nowiki></code> | ||
+ | |||
+ | |} | ||
+ | <!--TO DO: Add Super, Menu, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?, arrows.--> | ||
</noinclude> | </noinclude> |
Revision as of 13:05, 15 June 2020
A simple template that makes it easier to see that a keyboard key is involved.
Usage
{{Key press|key|border style}}
- key is the literal name of the key to be pressed. For F4, for example, the syntax is
{{Key press|F4}}
. This results in the following: F4 - HTML character entities are allowed. For example, to display the multiplication symbol, this works:
{{Key press|×}}
and results in ×. - To display a pressed key, add
inset
border style like this:{{Key press|F4|inset}}
and the key will appear to be pressed: F4. - The key and border parameters can be reversed, but then their names need to be specified:
{{Key press|border=inset|key=F4}}
will become F4 - Forgetting to specify a key will default to the equals sign:
{{Key press}}
becomes =.
Common keys
For ease of use and consistency throughout pages, the code for some common multi-letter keys is provided here, ready to be copied and pasted into articles. Symbols rely on UTF-8 support by the browser and a font that contains the glyph, so for best compatibility, the text-only version of the code can be recommended for use in most articles. Not every key has a corresponding symbol.
Key | Text | Symbol | Symbol with text | Text with symbol |
---|---|---|---|---|
Shift |
|
|
|
|
Control |
|
|
|
|
Command |
|
|
|
|
Option |
|
|
|
|
Alt |
|
|||
Alt Graph |
|
|||
Space |
|
|
|
|
Enter |
|
|
|
|