Actions

Template

Template:Key

From Project Rebearth

Revision as of 10:34, 26 February 2026 by East6 (talk | contribs) (Created page with "<includeonly><templatestyles src="Key/styles.css" /><kbd class="keyboard-key nowrap">{{{1}}}</kbd>{{#if:{{{2|}}}|<span style="padding:0 0.3em;font-size:0.85em;">+</span><kbd class="keyboard-key nowrap">{{{2}}}</kbd>}}{{#if:{{{3|}}}|<span style="padding:0 0.3em;font-size:0.85em;">+</span><kbd class="keyboard-key nowrap">{{{3}}}</kbd>}}{{#if:{{{4|}}}|<span style="padding:0 0.3em;font-size:0.85em;">+</span><kbd class="keyboard-key nowrap">{{{4}}}</kbd>}}</includeonly><noinc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Key

[edit]

Displays one or more keyboard keys in a styled inline box, similar to Wikipedia's {{Key press}} template.

Usage

[edit]

Single key:

{{Key|Esc}}

Key combination:

{{Key|Ctrl|C}}

Three-key combination:

{{Key|Ctrl|Shift|S}}

Parameters

[edit]
Parameter Required Description
1 Yes First key name (e.g. "Ctrl", "Esc", "Enter", "A").
2 No Second key in a combination.
3 No Third key in a combination.
4 No Fourth key in a combination.

Examples

[edit]
Wikitext Result
{{Key|Esc}} Esc
{{Key|Ctrl|C}} Ctrl+C
{{Key|Ctrl|Shift|S}} Ctrl+Shift+S
{{Key|Enter}} Enter
{{Key|↑}}

Notes

[edit]
  • Keys are rendered using the HTML <kbd> element with a subtle gradient background and border, matching Wikipedia's keyboard key styling.
  • You can pass Unicode symbols directly (e.g. , ) as key names.
  • For combinations, keys are automatically joined with a + separator.