Template:Keypress: Difference between revisions

From Vintage Story Wiki
(creating template.)
 
(oh my god TemplateStyles my saviour)
Line 1: Line 1:
<includeonly><span {{#if: {{{keyClass|}}} | class="key {{{keyClass}}}" | class="key" }} {{#if: {{{keyID|}}} | id="{{{keyID}}}" }}"><span>{{{1}}}</span></span></includeonly><noinclude>
<templatestyles src="Keypress/styles.css" />
<includeonly><kbd class="keyboard-key nowrap">{{{1|}}}</kbd></includeonly><noinclude>
{{doc}}
{{doc}}
</noinclude>
</noinclude>

Revision as of 22:12, 6 August 2023


[view | edit | history | purge this page]Documentation

This template allows users to use in-line "keypress" formatting, for demonstrating which keyboard key(s) a user should press. There is currently no special key for mouse clicks. The CSS and overall style is taken from English Wikipedia's Key press template, albeit currently without the Lua module.

Usage

The template can be used for regular keys by inserting the following: {{Keypress|W}}. The first parameter is the display text.

{{Keypress
|Display text (must be first!)
}}

Parameters

Parameters Description Type Required
1 The display text of the key. any yes

Examples

Key type Template text Result
Regular key {{keypress|e}}

e

Modifier (Shift, Ctrl, Alt) {{keypress|CTRL}}

CTRL

Spacebar {{keypress|Space}}

Space

Function keys (F1-12, Esc) {{Keypress|F5}}

F5

Arbitrary symbols and strings {{keypress|⇧ Shift+⊞ Win+≣ Menu}}

⇧ Shift+⊞ Win+≣ Menu

[view | edit | history | purge this page]The above documentation is transcluded from Template:Keypress/doc.