Difference between revisions of "Template:Key press"

From Zero-K
Jump to navigation Jump to search
(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.)
(Added tab key, removed wrong arrow (for Shift).)
Line 29: Line 29:
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uArr;}}</nowiki></code>
 
 
|
 
|
 
;{{{{BASEPAGENAME}}|&#8679; Shift}}
 
;{{{{BASEPAGENAME}}|&#8679; Shift}}
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679; Shift}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#8679; Shift}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679; Shift}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#8679; Shift}}</nowiki></code>
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;uArr; Shift}}</nowiki></code>
 
 
|
 
|
 
;{{{{BASEPAGENAME}}|Shift &#8679;}}
 
;{{{{BASEPAGENAME}}|Shift &#8679;}}
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &amp;#8679;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &amp;#8679;}}</nowiki></code>
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Shift &amp;uArr;}}</nowiki></code>
 
  
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
Line 241: Line 238:
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;#8595;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;#8595;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;darr;}}</nowiki></code>
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Down &amp;darr;}}</nowiki></code>
 +
 +
|- style="vertical-align:top"
 +
! scope="row" style="text-align:left"|Tab
 +
|
 +
;{{{{BASEPAGENAME}}|Tab}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Tab}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#11134;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#11134;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#11134;}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|&#11134; Tab}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&#11134; Tab}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|&amp;#11134; Tab}}</nowiki></code>
 +
|
 +
;{{{{BASEPAGENAME}}|Tab &#11134;}}
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Tab &#11134;}}</nowiki></code>
 +
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|Tab &amp;#11134;}}</nowiki></code>
  
 
|}
 
|}
<!--TO DO: Add Super, Menu, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?.-->
+
<!--TO DO: Add ?Super?, ?Menu?, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?.-->
 
</noinclude>
 
</noinclude>

Revision as of 15:41, 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;}}
⇧ Shift
{{Key press|⇧ Shift}}
{{Key press|&#8679; Shift}}
Shift ⇧
{{Key press|Shift ⇧}}
{{Key press|Shift &#8679;}}
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;}}
Tab
Tab
{{Key press|Tab}}
{{Key press|⭾}}
{{Key press|&#11134;}}
⭾ Tab
{{Key press|⭾ Tab}}
{{Key press|&#11134; Tab}}
Tab ⭾
{{Key press|Tab ⭾}}
{{Key press|Tab &#11134;}}