Template:Key: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
(blanking until the variables extension is installed to prevent messy stuff on the few pages already using that template)
Tag: Blanking
(test with variables extension installed)
Line 1: Line 1:
<includeonly>{{#vardefine:console|{{#if:{{{console|}}}|{{lc:{{{console}}}}}|{{#if:{{{2|}}}|{{lc:{{{1}}}}}}}}}}}<!--
-->{{#vardefine:key|{{#switch:{{lc:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}}
| leftstick
| left stick
| left thumbstick
| lstick = Left Stick
| rightstick
| right stick
| right thumbstick
| rstick = Right Stick
| left trigger
| lt = LT
| left bumper
| lb = LB
| right trigger
| rt = RT
| right bumper
| rb = RB
| left d-pad
| left dpad
| l = Left
| right d-pad
| right dpad
| r = Right
| up d-pad
| up dpad
| u = Up
| down d-pad
| down dpad
| d = Down
| d-pad
| dpad = Dpad
| m = Menu
| o = Circle
| touchpad = Touch Pad
| lmb
| left click = Left
| rmb
| right click = Right
| #default = {{ucfirst:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}}
}}}}<!--
-->{{#vardefine:keyboard|{{lc:{{#if:{{{keyboard|}}}|{{{keyboard}}}|{{#if:{{{2|}}}||{{{1|}}}}}}}}}}}<!--


-->{{#if: {{#var:console}} | [[File:{{#switch: {{#var:console}}
|playstation 3
|ps3=PS3
|ps
|playstation
|playstation 4
|ps4=PS4
|psmove
|move=PSMove
|xbox360
|360=360
|gesture=Gesture
|keyboard
|mouse=Keyboard
|oculus=Oculus
|remote=Remote
|steam=Steam
|switch=Switch
|vita=Vita
|vive=Vive
|wii=Wii
|wiiu=WiiU
|xbox
|xbox one
|xboxone
|xbone
|xbox1=XboxOne
|ouya=Ouya
|undefined}}<!--
-->{{#ifeq:{{#var:console}}|mouse|{{#switch: {{lc:{{{variant}}}}}
|dark=_White_Mouse_
|light=_Black_Mouse_
|#default = _White_Mouse_
}}}} {{#var:key}}.png|alt={{#var:key}}|{{{size|20px}}}|{{{link|Controls}}}|{{#var:key}}]] }}<!--the above depends on the presence of keyname.png, and only affects console keys, so it doesn't matter for now. Leaving it for future purposes
The following handles the keyboard keys display
-->{{#if: {{#var:keyboard}} | <span class="key">[[Controls|<kbd class="{{#switch: {{lc:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysDark}}"><!--
-->{{#switch:{{#var:keyboard}}
<!--Standard keyboard values-->
|caps lock = ⇪ Caps Lock
|shift = ⇧ Shift
|lshift
|left shift = ⇧ Left Shift
|rshift
|right shift = ⇧ Right Shift
|return = ↵ Return
|enter = ↵ Enter
|esc = Esc
|ctrl = Ctrl
|lctrl
|left ctrl = Left Ctrl
|rctrl
|right ctrl = Right Ctrl
|alt = Alt
|lalt
|left alt = Left Alt
|ralt
|right alt = Right Alt
|cmd = ⌘ Cmd
|command = ⌘ Command
|opt
|option = ⌥ Option
|tab = Tab ↹
|backspace = ← Backspace
|space = Spacebar
|super = ⊞ Super
|menu = ≣ Menu
|windows = ⊞ Windows
|up = ↑
|down = ↓
|left = ←
|right = →
|#default = {{ucfirst:{{#var:keyboard}}}}
}}</kbd>]]</span>
}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>

Revision as of 18:08, 11 January 2021

Documentation

When used, this template displays game controls, supporting both keyboard keys and controller buttons. Images will need to be added for the latter.

Those keys are also links to the Controls page, although this can be changed to another page by editing the relevant link in Template:Key.

Usage

{{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.
  • These keys are not case sensitive, so shift and Shift will both give ⇧ Shift.

For mouse buttons:

{{key | mouse | button}}

Example

Press {{Key|Alt}} and {{Key|f4}} at the same time.

produces:
Press Alt and F4 at the same time.

Themes

Light: Spacebar Dark: Spacebar

Mouse Buttons

Default theme: Light
LeftMiddleRightMouse

Keyboard Keys

Default theme: Dark

Numbers

0123456789

Letters & Punctuation

ABCDEFGHIJKLMNOPQRSTUVWXYZ
*[]<>-+?" ;\Spacebar~

Special

AltBkspCaps⌘ CmdCtrlDelEnd↵ EnterEscHomeInsNum lockPage downPage upPrint screen⇧ ShiftTab ↹⊞ Windows
F1F2F3F4F5F6F7F8F9F10F11F12

Alternate Models

← Backspace↵ Enter↵ EnterPlus⇧ Shift