Difference between revisions of "Template:Key press"

From Zero-K
Jump to navigation Jump to search
(Created page with "<includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em>{{{key|{{{1|=}}}}}}</kbd></includeonly><noinclude>A...")
 
m (Border too thin, make it medium again.)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em>{{{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;white-space:nowrap;overflow:hidden;font-family:sans-serif;line-height:1.3em;margin:-.2em auto;vertical-align:text-bottom">{{{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.
 
+
-->{{Documentation}}
==Usage==
 
<code><nowiki>{{</nowiki>Key press<nowiki>|key|border style}}</nowiki></code>
 
* key 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}}
 
* 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;}}.
 
* To display a pressed key, add ''inset'' 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}}.
 
* The ''key'' and ''border'' 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 }}.
 
 
</noinclude>
 
</noinclude>

Latest revision as of 22:44, 9 February 2024

Template documentation[view] [edit] [history] [purge]

A simple template that makes it easier to see that a keyboard key is involved. Use {{key combo}} if two or more keys need to be pressed at the same time instead of this template.

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.

Cursor control
Key Text Symbol Symbol with text Text with symbol
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;}}
Modifier 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}}
Other often-used keys
Key Text Symbol Symbol with text Text with symbol
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;}}
Tab
Tab
{{Key press|Tab}}
{{Key press|↹}}
{{Key press|&#8633;}}
(better, but less compatible)
{{Key press|⭾}}
{{Key press|&#11134;}}
↹ Tab
{{Key press|↹ Tab}}
{{Key press|&#8633; Tab}}
⭾ Tab
{{Key press|⭾ Tab}}
{{Key press|&#11134; Tab}}
Tab ↹
{{Key press|Tab ↹}}
{{Key press|Tab &#8633;}}
Tab ⭾
{{Key press|Tab ⭾}}
{{Key press|Tab &#11134;}}
Escape
Esc
{{Key press|Esc}}
{{Key press|⎋}}
{{Key press|&#9099;}}
⎋ Esc
{{Key press|⎋ Esc}}
{{Key press|&#9099; Esc}}
Esc ⎋
{{Key press|Esc ⎋}}
{{Key press|Esc &#9099;}}