Template:Key/doc
When used, this template displays keyboard keys. For controller buttons, use Template:Button.
- This template's display is styled using the
.keysDark
and.keysLight
classes located in MediaWiki:Common.css.
Usage[edit source]
- Note: For an example of possible keys, see Template:Key/library.
There is only one required input:
{{key | button }}
button
is the keyboard key to be pressed. Some key inputs, such as Shift or Tab will automatically add symbols or other formatting. Any other inputs will be output as they are with the first letter capitalized.
Optionally you can add a second parameter:
{{key | button | keyboardvariant }}
keyboardvariant
determines whether the key is light text on a dark key (default) or the inverse. This will likely never be used, and if a wiki would prefer dark on light, it should be changed as the default.
Example[edit source]
Press {{Key|Shift}} and {{Key|F}} at the same time.
produces:
Press ⇧ Shift and F at the same time.
Changing the default color[edit source]
The default color for the keyboard is suitable for lighter-skinned wikis. To change the default settings so it fits for a light-skinned wiki, without having to use keyboardvariant = light
each time, you can search for and change this section in the template:
Search for: <kbd class="{{#switch: {{lc:{{{2}}}}}|dark=keysDark|light=keysLight|keysLight}}">
...and change keysLight}}
at the end of the line to keysDark}}
.