Difference between revisions of "Template:Key"

From RimWorld Wiki
Jump to navigation Jump to search
(Imported from https://help.gamepedia.com/Gamepedia_Help_Wiki)
(Set defaults to light skin version)
Line 50: Line 50:
 
|dark=_White_Mouse_
 
|dark=_White_Mouse_
 
|light=_Black_Mouse_
 
|light=_Black_Mouse_
|#default = _White_Mouse_
+
|#default = _Black_Mouse_
 
}}}} {{#var:key}}.png|{{{size|20px}}}|{{{link|Controls}}}]] }}<!--
 
}}}} {{#var:key}}.png|{{{size|20px}}}|{{{link|Controls}}}]] }}<!--
  
-->{{#if: {{#var:keyboard}} | <span class="key" style="display:inline-block; white-space:nowrap;">[[Controls|<kbd class="{{#switch: {{lc:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysDark}}"><!--
+
-->{{#if: {{#var:keyboard}} | <span class="key" style="display:inline-block; white-space:nowrap;">[[Controls|<kbd class="{{#switch: {{lc:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysLight}}"><!--
  
 
-->{{#switch:{{#var:keyboard}}
 
-->{{#switch:{{#var:keyboard}}

Revision as of 13:29, 15 July 2019

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

When used, this template displays game controls, supporting both keyboard keys and controller buttons.

  • This template's display is styled using the .keysDark and .keysLight classes located in MediaWiki:Common.css.

Usage

Keyboard

{{key | keyboard = keyboard key | keyboardvariant = dark or light }}

  • The keyboard parameter is the keyboard key to be pressed.
  • The keyboardvariant parameter is the graphic style and is not required - the template defaults to dark, rendering a white key with black text. Enter dark for dark wikis, or light for light wikis.

Controller

{{key | console = console type | key = controller button | size = optional size }}

  • The console parameter is used to state which console the key belongs to. The parameter is not case-sensitive. See Template:Key/library for possible values.
  • The button parameter is the button to be pressed, such as "A" or "Cross". Note that this template uses the registered trademark names, i.e. "cross" instead of "X" for Playstation buttons, but the template has alternative spellings and entries included. See Template:Key/library for possible values.
  • The size parameter is optional, and sizes the button image. If this parameter is not entered, the default image size is 50px.

Examples

Keyboard

The keyboardvariant parameter does not usually need to be entered explicitly. A default is generally set during a wiki's spinup. The parameter is used here to illustrate the two available versions.

⇪ Caps Lock

{{key
| keyboard = caps lock
| keyboardvariant = dark
}}

Or for light wikis:

⇪ Caps Lock

{{key
| keyboard = caps lock
| keyboardvariant = light
}}

Keyboard keys can be entered in shorthand like this: ⇪ Caps Lock

{{key|caps lock}}