Difference between revisions of "Template:Key press"

From Zero-K
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|&#8679;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8679;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;uArr;}}</nowiki></code>
 +
|
 +
;{{Key press|&#8679; Shift}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679; Shift}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8679; Shift}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;uArr; Shift}}</nowiki></code>
 +
|
 +
;{{Key press|Shift &#8679;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &#8679;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &amp;#8679;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &amp;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|&#8984;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8984;}}</nowiki></code>
 +
|
 +
;{{Key press|&#8984; Command}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984; Command}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8984; Command}}</nowiki></code>
 +
|
 +
;{{Key press|Command &#8984;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Command &#8984;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Command &amp;#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|&#8997;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8997;}}</nowiki></code>
 +
|
 +
;{{Key press|&#8997; Option}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997; Option}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8997; Option}}</nowiki></code>
 +
|
 +
;{{Key press|Option &#8997;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Option &#8997;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Option &amp;#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|&#9141;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#9141;}}</nowiki></code>
 +
|
 +
;{{Key press|&#9141; Space}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141; Space}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#9141; Space}}</nowiki></code>
 +
|
 +
;{{Key press|Space &#9141;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Space &#9141;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Space &amp;#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|&#8629;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8629;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;crarr;}}</nowiki></code>
 +
;{{Key press|&#8996;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8996;}}</nowiki></code>
 +
|
 +
;{{Key press|&#8629; Enter}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629; Enter}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8629; Enter}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;crarr; Enter}}</nowiki></code>
 +
;{{Key press|&#8996; Enter}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996; Enter}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8996; Enter}}</nowiki></code>
 +
|
 +
;{{Key press|Enter &#8629;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8629;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;#8629;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;crarr;}}</nowiki></code>
 +
;{{Key press|Enter &#8996;}}
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8996;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;#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 14: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|&times;}} 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.

Often-used keys
Key Text Symbol Symbol with text Text with symbol
Shift
Shift
{{Key press|Shift}}
{{Key press|⇧}}
{{Key press|&#8679;}}
{{Key press|&uArr;}}
⇧ Shift
{{Key press|⇧ Shift}}
{{Key press|&#8679; Shift}}
{{Key press|&uArr; Shift}}
Shift ⇧
{{Key press|Shift ⇧}}
{{Key press|Shift &#8679;}}
{{Key press|Shift &uArr;}}
Control
Ctrl
{{Key press|Ctrl}}
^
{{Key press|^}}
^ Ctrl
{{Key press|^ Ctrl}}
Ctrl ^
{{Key press|Ctrl ^}}
Command
Command
{{Key press|Command}}
{{Key press|⌘}}
{{Key press|&#8984;}}
⌘ Command
{{Key press|⌘ Command}}
{{Key press|&#8984; Command}}
Command ⌘
{{Key press|Command ⌘}}
{{Key press|Command &#8984;}}
Option
Option
{{Key press|Option}}
{{Key press|⌥}}
{{Key press|&#8997;}}
⌥ Option
{{Key press|⌥ Option}}
{{Key press|&#8997; Option}}
Option ⌥
{{Key press|Option ⌥}}
{{Key press|Option &#8997;}}
Alt
Alt
{{Key press|Alt}}
Alt Graph
AltGr
{{Key press|AltGr}}
Space
Space
{{Key press|Space}}
{{Key press|⎵}}
{{Key press|&#9141;}}
⎵ Space
{{Key press|⎵ Space}}
{{Key press|&#9141; Space}}
Space ⎵
{{Key press|Space ⎵}}
{{Key press|Space &#9141;}}
Enter
Enter
{{Key press|Enter}}
{{Key press|↵}}
{{Key press|&#8629;}}
{{Key press|&crarr;}}
{{Key press|⌤}}
{{Key press|&#8996;}}
↵ Enter
{{Key press|↵ Enter}}
{{Key press|&#8629; Enter}}
{{Key press|&crarr; Enter}}
⌤ Enter
{{Key press|⌤ Enter}}
{{Key press|&#8996; Enter}}
Enter ↵
{{Key press|Enter ↵}}
{{Key press|Enter &#8629;}}
{{Key press|Enter &crarr;}}
Enter ⌤
{{Key press|Enter ⌤}}
{{Key press|Enter &#8996;}}