Difference between revisions of "Template:Key press"

From Zero-K
Jump to navigation Jump to search
(Added to documentation: Some code that can be copied into articles. WIP, needs more keys added.)
(Added cursor control keys, changed table header color to make sorting arrows visible (this probably needs to be perma-fixed in places where only admins can go). Now using a variable for template name.)
Line 3: Line 3:
  
 
==Usage==
 
==Usage==
<code><nowiki>{{</nowiki>Key press<nowiki>|key|border style}}</nowiki></code>
+
<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|key|border style}}</nowiki></code>
* <var>key</var> is the literal name of the key to be pressed. For ''F4'', for example, the syntax is <code><nowiki>{{</nowiki>Key press<nowiki>|F4}}</nowiki></code>. This results in the following: {{Key press|F4}}
+
* <var>key</var> is the literal name of the key to be pressed. For ''F4'', for example, the syntax is <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|F4}}</nowiki></code>. This results in the following: {{{{BASEPAGENAME}}|F4}}
* HTML character entities are allowed. For example, to display the multiplication symbol, this works: <code><nowiki>{{</nowiki>Key press|'''<nowiki>&amp;times;</nowiki>'''<nowiki>}}</nowiki></code> and results in {{Key press|&times;}}.
+
* HTML character entities are allowed. For example, to display the multiplication symbol, this works: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|'''<nowiki>&amp;times;</nowiki>'''<nowiki>}}</nowiki></code> and results in {{{{BASEPAGENAME}}|&times;}}.
* To display a pressed key, add <code>inset</code> border style like this: <code><nowiki>{{</nowiki>Key press<nowiki>|F4|inset}}</nowiki></code> and the key will appear to be pressed: {{Key press|F4|inset}}.
+
* To display a pressed key, add <code>inset</code> border style like this: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|F4|inset}}</nowiki></code> and the key will appear to be pressed: {{{{BASEPAGENAME}}|F4|inset}}.
* 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>{{BASEPAGENAME}}<nowiki>|border=inset|key=F4}}</nowiki></code> will become {{{{BASEPAGENAME}}|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>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> becomes {{{{BASEPAGENAME}} }}.
  
 
==Common keys==
 
==Common keys==
Line 14: Line 14:
 
{| class="wikitable sortable" style="margin-left:auto; margin-right:auto"
 
{| class="wikitable sortable" style="margin-left:auto; margin-right:auto"
 
|+Often-used keys
 
|+Often-used keys
! scope="col"|Key
+
! scope="col" style="background-color:#069"|Key
! scope="col"|Text
+
! scope="col" style="background-color:#069"|Text
! scope="col"|Symbol
+
! scope="col" style="background-color:#069"|Symbol
! scope="col"|Symbol with text
+
! scope="col" style="background-color:#069"|Symbol with text
! scope="col"|Text with symbol
+
! scope="col" style="background-color:#069"|Text with symbol
  
 
|- style="vertical-align:top"  
 
|- style="vertical-align:top"  
 
! scope="row" style="text-align:left"|Shift
 
! scope="row" style="text-align:left"|Shift
 
|
 
|
;{{Key press|Shift}}
+
;{{{{BASEPAGENAME}}|Shift}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift}}</nowiki></code>
 
|
 
|
;{{Key press|&#8679;}}
+
;{{{{BASEPAGENAME}}|&#8679;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8679;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;uArr;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uArr;}}</nowiki></code>
 
|
 
|
;{{Key press|&#8679; Shift}}
+
;{{{{BASEPAGENAME}}|&#8679; Shift}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679; Shift}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679; Shift}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8679; Shift}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679; Shift}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;uArr; Shift}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uArr; Shift}}</nowiki></code>
 
|
 
|
;{{Key press|Shift &#8679;}}
+
;{{{{BASEPAGENAME}}|Shift &#8679;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &#8679;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &amp;#8679;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &amp;#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &amp;uArr;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &amp;uArr;}}</nowiki></code>
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
! scope="row" style="text-align:left"|Control
 
! scope="row" style="text-align:left"|Control
 
|
 
|
;{{Key press|Ctrl}}
+
;{{{{BASEPAGENAME}}|Ctrl}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Ctrl}}</nowiki></code>
 
|
 
|
;{{Key press|^}}
+
;{{{{BASEPAGENAME}}|^}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|^}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|^}}</nowiki></code>
 
|
 
|
;{{Key press|^ Ctrl}}
+
;{{{{BASEPAGENAME}}|^ Ctrl}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|^ Ctrl}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|^ Ctrl}}</nowiki></code>
 
|
 
|
;{{Key press|Ctrl ^}}
+
;{{{{BASEPAGENAME}}|Ctrl ^}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl ^}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Ctrl ^}}</nowiki></code>
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
! scope="row" style="text-align:left"|Command
 
! scope="row" style="text-align:left"|Command
 
|
 
|
;{{Key press|Command}}
+
;{{{{BASEPAGENAME}}|Command}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Command}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Command}}</nowiki></code>
 
|
 
|
;{{Key press|&#8984;}}
+
;{{{{BASEPAGENAME}}|&#8984;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8984;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8984;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8984;}}</nowiki></code>
 
|
 
|
;{{Key press|&#8984; Command}}
+
;{{{{BASEPAGENAME}}|&#8984; Command}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984; Command}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8984; Command}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8984; Command}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8984; Command}}</nowiki></code>
 
|
 
|
;{{Key press|Command &#8984;}}
+
;{{{{BASEPAGENAME}}|Command &#8984;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Command &#8984;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Command &#8984;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Command &amp;#8984;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Command &amp;#8984;}}</nowiki></code>
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
! scope="row" style="text-align:left"|Option
 
! scope="row" style="text-align:left"|Option
 
|
 
|
;{{Key press|Option}}
+
;{{{{BASEPAGENAME}}|Option}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Option}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Option}}</nowiki></code>
 
|
 
|
;{{Key press|&#8997;}}
+
;{{{{BASEPAGENAME}}|&#8997;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8997;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8997;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8997;}}</nowiki></code>
 
|
 
|
;{{Key press|&#8997; Option}}
+
;{{{{BASEPAGENAME}}|&#8997; Option}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997; Option}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8997; Option}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8997; Option}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8997; Option}}</nowiki></code>
 
|
 
|
;{{Key press|Option &#8997;}}
+
;{{{{BASEPAGENAME}}|Option &#8997;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Option &#8997;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Option &#8997;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Option &amp;#8997;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Option &amp;#8997;}}</nowiki></code>
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
! scope="row" style="text-align:left"|Alt
 
! scope="row" style="text-align:left"|Alt
 
|
 
|
;{{Key press|Alt}}
+
;{{{{BASEPAGENAME}}|Alt}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Alt}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Alt}}</nowiki></code>
 
|
 
|
 
|
 
|
Line 104: Line 104:
 
! scope="row" style="text-align:left"|Alt Graph
 
! scope="row" style="text-align:left"|Alt Graph
 
|
 
|
;{{Key press|AltGr}}
+
;{{{{BASEPAGENAME}}|AltGr}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|AltGr}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|AltGr}}</nowiki></code>
 
|
 
|
 
|
 
|
Line 113: Line 113:
 
! scope="row" style="text-align:left"|Space
 
! scope="row" style="text-align:left"|Space
 
|
 
|
;{{Key press|Space}}
+
;{{{{BASEPAGENAME}}|Space}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Space}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Space}}</nowiki></code>
 
|
 
|
;{{Key press|&#9141;}}
+
;{{{{BASEPAGENAME}}|&#9141;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#9141;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#9141;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#9141;}}</nowiki></code>
 
|
 
|
;{{Key press|&#9141; Space}}
+
;{{{{BASEPAGENAME}}|&#9141; Space}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141; Space}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#9141; Space}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#9141; Space}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#9141; Space}}</nowiki></code>
 
|
 
|
;{{Key press|Space &#9141;}}
+
;{{{{BASEPAGENAME}}|Space &#9141;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Space &#9141;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Space &#9141;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Space &amp;#9141;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Space &amp;#9141;}}</nowiki></code>
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
! scope="row" style="text-align:left"|Enter
 
! scope="row" style="text-align:left"|Enter
 
|
 
|
;{{Key press|Enter}}
+
;{{{{BASEPAGENAME}}|Enter}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter}}</nowiki></code>
 
|
 
|
;{{Key press|&#8629;}}
+
;{{{{BASEPAGENAME}}|&#8629;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8629;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8629;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8629;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;crarr;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;crarr;}}</nowiki></code>
;{{Key press|&#8996;}}
+
;{{{{BASEPAGENAME}}|&#8996;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8996;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8996;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8996;}}</nowiki></code>
 
|
 
|
;{{Key press|&#8629; Enter}}
+
;{{{{BASEPAGENAME}}|&#8629; Enter}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629; Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8629; Enter}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8629; Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8629; Enter}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;crarr; Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;crarr; Enter}}</nowiki></code>
;{{Key press|&#8996; Enter}}
+
;{{{{BASEPAGENAME}}|&#8996; Enter}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996; Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8996; Enter}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|&amp;#8996; Enter}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8996; Enter}}</nowiki></code>
 
|
 
|
;{{Key press|Enter &#8629;}}
+
;{{{{BASEPAGENAME}}|Enter &#8629;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8629;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter &#8629;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;#8629;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter &amp;#8629;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;crarr;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter &amp;crarr;}}</nowiki></code>
;{{Key press|Enter &#8996;}}
+
;{{{{BASEPAGENAME}}|Enter &#8996;}}
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8996;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter &#8996;}}</nowiki></code>
:<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &amp;#8996;}}</nowiki></code>
+
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Enter &amp;#8996;}}</nowiki></code>
 +
 
 +
|- style="vertical-align:top"
 +
! scope="row" style="text-align:left"|Left
 +
|
 +
;{{{{BASEPAGENAME}}|Left}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Left}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8592;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8592;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8592;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;larr;}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8592; Left}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8592; Left}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8592; Left}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;larr; Left}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|Left &#8592;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Left &#8592;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Left &amp;#8592;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Left &amp;larr;}}</nowiki></code>
 +
 
 +
|- style="vertical-align:top"
 +
! scope="row" style="text-align:left"|Up
 +
|
 +
;{{{{BASEPAGENAME}}|Up}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Up}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8593;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8593;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8593;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uarr;}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8593; Up}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8593; Up}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8593; Up}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uarr; Up}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|Up &#8593;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Up &#8593;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Up &amp;#8593;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Up &amp;uarr;}}</nowiki></code>
 +
 
 +
|- style="vertical-align:top"
 +
! scope="row" style="text-align:left"|Right
 +
|
 +
;{{{{BASEPAGENAME}}|Right}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Right}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8594;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8594;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8594;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;rarr;}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8594; Right}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8594; Right}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8594; Right}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;rarr; Right}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|Right &#8594;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Right &#8594;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Right &amp;#8594;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Right &amp;rarr;}}</nowiki></code>
 +
 
 +
|- style="vertical-align:top"
 +
! scope="row" style="text-align:left"|Down
 +
|
 +
;{{{{BASEPAGENAME}}|Down}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8595;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8595;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8595;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;darr;}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#8595; Down}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8595; Down}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8595; Down}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;darr; Down}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|Down &#8595;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &#8595;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;#8595;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;darr;}}</nowiki></code>
  
 
|}
 
|}
<!--TO DO: Add Super, Menu, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?, arrows.-->
+
<!--TO DO: Add Super, Menu, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?.-->
 
</noinclude>
 
</noinclude>

Revision as of 13:43, 16 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;}}
Left
Left
{{Key press|Left}}
{{Key press|←}}
{{Key press|&#8592;}}
{{Key press|&larr;}}
← Left
{{Key press|← Left}}
{{Key press|&#8592; Left}}
{{Key press|&larr; Left}}
Left ←
{{Key press|Left ←}}
{{Key press|Left &#8592;}}
{{Key press|Left &larr;}}
Up
Up
{{Key press|Up}}
{{Key press|↑}}
{{Key press|&#8593;}}
{{Key press|&uarr;}}
↑ Up
{{Key press|↑ Up}}
{{Key press|&#8593; Up}}
{{Key press|&uarr; Up}}
Up ↑
{{Key press|Up ↑}}
{{Key press|Up &#8593;}}
{{Key press|Up &uarr;}}
Right
Right
{{Key press|Right}}
{{Key press|→}}
{{Key press|&#8594;}}
{{Key press|&rarr;}}
→ Right
{{Key press|→ Right}}
{{Key press|&#8594; Right}}
{{Key press|&rarr; Right}}
Right →
{{Key press|Right →}}
{{Key press|Right &#8594;}}
{{Key press|Right &rarr;}}
Down
Down
{{Key press|Down}}
{{Key press|↓}}
{{Key press|&#8595;}}
{{Key press|&darr;}}
↓ Down
{{Key press|↓ Down}}
{{Key press|&#8595; Down}}
{{Key press|&darr; Down}}
Down ↓
{{Key press|Down ↓}}
{{Key press|Down &#8595;}}
{{Key press|Down &darr;}}