Template:Key/doc: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{doc/start}} | {{doc/start}} | ||
When used, this template displays game controls, supporting both keyboard keys and controller buttons. | When used, this template displays game controls, supporting both keyboard keys and controller buttons. | ||
* This template's display is styled using the <code>. | * This template's display is styled using the <code>.dark</code> and <code>.light</code> classes located in [[Template:Key/style.css]]. | ||
== Usage == | == Usage == | ||
Line 11: | Line 11: | ||
'''<code><nowiki>{{</nowiki>key | ''button'' <nowiki>}}</nowiki></code>''' | '''<code><nowiki>{{</nowiki>key | ''button'' <nowiki>}}</nowiki></code>''' | ||
* <code>button</code> 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. | * <code>button</code> 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. | ||
* ''Optional'': there is an additional parameter, <code> | * ''Optional'': there is an additional parameter, <code>color</code> which determines whether the key is dark text on a light key (default) or the inverse. This will likely never be used, and if a wiki would prefer light on dark, it should be changed as the default. | ||
====Example==== | ====Example==== | ||
Line 31: | Line 31: | ||
== Changing the default color == | == Changing the default color == | ||
The default color for the keyboard and mouse is suitable for dark-skinned wikis. To change the default settings so it fits for a light-skinned wiki, without having to use <code> | The default color for the keyboard and mouse is suitable for dark-skinned wikis. To change the default settings so it fits for a light-skinned wiki, without having to use <code>color = light</code> each time, you can search for and change these sections in the template: | ||
Line 38: | Line 38: | ||
Search for: <code><nowiki><kbd class="{{#switch: {{lc:{{{ | Search for: <code><nowiki><kbd class="{{#switch: {{lc:{{{color}}}}} |dark=dark|light=light|</nowiki><div style="color: #00ff00;">light</div>}}"></code><br/> | ||
...and change '' | ...and change ''light'' at the end of the line to <code>''dark''</code>. | ||
{{doc/end}} | {{doc/end}} |
Revision as of 08:30, 29 June 2022
When used, this template displays game controls, supporting both keyboard keys and controller buttons.
- This template's display is styled using the
.dark
and.light
classes located in Template:Key/style.css.
Usage
- Note: For a summary of possible console, key, and button values, see Template:Key/library.
Keyboard
If using the template for keyboard keys, there is only one required input. For mouse usage, see the #Consoles and controllers, using "mouse" as the console.
{{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.- Optional: there is an additional parameter,
color
which determines whether the key is dark text on a light key (default) or the inverse. This will likely never be used, and if a wiki would prefer light on dark, it should be changed as the default.
Example
Press {{Key|Shift}} and {{Key|F}} at the same time.
produces:
Press
⇧ Shift
and
at the same time.
Consoles and controllers
{{key | console | button | size = optional size }}
console
is the console the key belongs to. The parameter is not case-sensitive and supports many possible consoles. See Template:Key/library for possible values.button
is the button to be pressed, such as "A" or "Right Trigger". While the template tries to be intuitive such that the correct input for a button is whatever you think it is, if your attempt at a button isn't working, 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 20px.
Example
Press {{Key|Xbox|RT}} to open your inventory wheel and select the item with {{Key|Xbox|A}}
to open your inventory wheel and select the item with
Changing the default color
The default color for the keyboard and mouse is suitable for dark-skinned wikis. To change the default settings so it fits for a light-skinned wiki, without having to use color = light
each time, you can search for and change these sections in the template:
Search for: |#default = _White_Mouse_
...and change it to: |#default = _Black_Mouse_
<kbd class="{{#switch: {{lc:{{{color}}}}} |dark=dark|light=light|light}}">
...and change light at the end of the line to dark
.
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.