Template:Key: Difference between revisions
Created page with "<includeonly>{{#vardefine:console|{{#if:{{{console|}}}|{{lc:{{{console}}}}}|{{#if:{{{2|}}}|{{lc:{{{1}}}}}}}}}}}<!-- -->{{#vardefine:key|{{#switch:{{lc:{{#if:{{{key|}}}|{{{key}..." |
imported>FrozenPlum m Thought I had already fixed, but perhaps I forgot to save XD (trying to get things back where they were-ish, to make wiki public again) |
||
(16 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:console|{{#if:{{{console|}}}|{{lc:{{{console}}}}}|{{#if:{{{2|}}}|{{lc:{{{1}}}}}}}}}}}<!-- |
<onlyinclude><includeonly>{{#vardefine:console|{{#if:{{{console|}}}|{{lc:{{{console}}}}}|{{#if:{{{2|}}}|{{lc:{{{1}}}}}}}}}}}<!-- |
||
-->{{#vardefine:key|{{#switch:{{lc:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}} |
-->{{#vardefine:key|{{#switch:{{lc:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}} |
||
| leftstick |
| leftstick |
||
| left stick |
| left stick |
||
| left thumbstick |
|||
| lstick = Left Stick |
| lstick = Left Stick |
||
| rightstick |
| rightstick |
||
| right stick |
| right stick |
||
| right thumbstick |
|||
| rstick = Right Stick |
| rstick = Right Stick |
||
| left trigger |
|||
| lt = LT |
| lt = LT |
||
| left bumper |
|||
| lb = LB |
| lb = LB |
||
| right trigger |
|||
| rt = RT |
| rt = RT |
||
| right bumper |
|||
| rb = RB |
| rb = RB |
||
| left d-pad |
|||
| left dpad |
|||
| l = Left |
| l = Left |
||
| right d-pad |
|||
| right dpad |
|||
| r = Right |
| r = Right |
||
| up d-pad |
|||
| up dpad |
|||
| u = Up |
| u = Up |
||
| down d-pad |
|||
| down dpad |
|||
| d = Down |
| d = Down |
||
| d-pad |
|||
| dpad = Dpad |
|||
| m = Menu |
| m = Menu |
||
| o = Circle |
| o = Circle |
||
| touchpad = Touch Pad |
| touchpad = Touch Pad |
||
| lmb |
|||
| left click = Left |
|||
| rmb |
|||
| right click = Right |
|||
| #default = {{ucfirst:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}} |
| #default = {{ucfirst:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}} |
||
}}}}<!-- |
}}}}<!-- |
||
-->{{#vardefine:keyboard|{{lc:{{#if:{{{keyboard|}}}|{{{keyboard}}}|{{#if:{{{2|}}}||{{{1|}}}}}}}}}}}<!-- |
-->{{#vardefine:keyboard|{{lc:{{#if:{{{keyboard|}}}|{{{keyboard}}}|{{#if:{{{2|}}}||{{{1|}}}}}}}}}}}<!-- |
||
-->{{#if: {{#var:console}} | |
-->{{#if: {{#var:console}} | {{!((}}File:{{#switch: {{#var:console}} |
||
|playstation 3 |
|||
|ps3=PS3 |
|ps3=PS3 |
||
|ps |
|||
|playstation |
|||
|playstation 4 |
|||
|ps4=PS4 |
|ps4=PS4 |
||
|psmove |
|psmove |
||
Line 41: | Line 65: | ||
|wiiu=WiiU |
|wiiu=WiiU |
||
|xbox |
|xbox |
||
|xbox one |
|||
|xboxone |
|xboxone |
||
|xbone |
|xbone |
||
Line 51: | Line 76: | ||
|light=_Black_Mouse_ |
|light=_Black_Mouse_ |
||
|#default = _White_Mouse_ |
|#default = _White_Mouse_ |
||
}}}} {{#var:key}}.png |
}}}} {{#var:key}}.png{{!}}alt={{#var:key}}{{!}}{{{size|20px}}}{{!}}link={{{link|}}}{{!}}{{#var:key}}{{))!}} }}<!-- |
||
-->{{#if: {{#var:keyboard}} | <span class="key |
-->{{#if: {{#var:keyboard}} | <span class="key">{{#if:{{{link|}}}|{{!((}}{{{link|}}}{{!}}}}<kbd class="{{#switch: {{lc:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysDark}}"><!-- |
||
-->{{#switch:{{#var:keyboard}} |
-->{{#switch:{{#var:keyboard}} |
||
Line 64: | Line 89: | ||
|rshift |
|rshift |
||
|right shift = ⇧ Right Shift |
|right shift = ⇧ Right Shift |
||
|return = ↵ Return |
|||
|enter = ↵ Enter |
|enter = ↵ Enter |
||
|esc = Esc |
|esc = Esc |
||
Line 85: | Line 111: | ||
|menu = ≣ Menu |
|menu = ≣ Menu |
||
|windows = ⊞ Windows |
|windows = ⊞ Windows |
||
|up = ↑ |
|||
|down = ↓ |
|||
⚫ | |||
|left = ← |
|||
}}</kbd>]]</span> |
|||
|right = → |
|||
}}</includeonly><noinclude>{{doc}}[[Category:Formatting templates]]</noinclude> |
|||
⚫ | |||
}}</kbd>{{#if:{{{link|}}}|{{))!}}}}</span> |
|||
}}</includeonly></onlyinclude> |
|||
{{Documentation}} |
Latest revision as of 05:01, 29 March 2022
When used, this template displays game controls, supporting both keyboard keys and controller buttons.
- Images used by this template are hosted at Fandom Commons.
- This template's display is styled using the
.keysDark
and.keysLight
classes located in MediaWiki:Common.css.
Usage
- Note: For a summary of possible console, key, and button values, see 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,
keyboardvariant
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 {{#vardefine:console|}}{{#vardefine:key|{{{2}}}}}{{#vardefine:keyboard|shift}}Template:!((File:undefined {{#var:key}}.png|alt={{#var:key}}|20px|link=|{{#var:key}}Template:))!{{#var:keyboard}} and {{#vardefine:console|}}{{#vardefine:key|{{{2}}}}}{{#vardefine:keyboard|f}}Template:!((File:undefined {{#var:key}}.png|alt={{#var:key}}|20px|link=|{{#var:key}}Template:))!{{#var:keyboard}} 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 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 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}}
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 keyboardvariant = 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:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysDark}}">
...and change keysDark at the end of the line to keysLight
.