Template:Key: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
No edit summary
mNo edit summary
 
(27 intermediate revisions by 3 users not shown)
Line 1: Line 1:
-->
{{doc}}[[Category:Templates]] Credit to "Nicolae 'Xelu' Berbece" of "Those Awesome Guys" for key images.
<includeonly><onlyinclude>{{#vardefine:inputmethod|{{#switch:{{lc:{{{1}}}}}|mouse=mouse|#default=keyboard}}}}<!--


<includeonly>{{#vardefine:console|{{#if:{{{console|}}}|{{lc:{{{console}}}}}|{{#if:{{{2|}}}|{{lc:{{{1}}}}}}}}}}}<!--
Mouse Buttons:
-->{{#vardefine:key|{{#switch:{{lc:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}}
-->{{#ifeq:{{#var:inputmethod}}|mouse|{{#vardefine:button|{{#switch:{{lc:{{{2}}}}}
| leftstick
| primary | one | 1 | left | l = Left
| left stick
| three | 3 | middle | m = Middle
| left thumbstick
| secondary | two | 2 | right | r = Right
| lstick = Left Stick
| #default = Simple
| rightstick
}}}}[[File:Mouse {{#var:button}} Key {{ucfirst:{{{theme|Light}}}}}.png|x{{{size|28px}}}|{{#ifeq:{{#var:button}}|Simple||{{#var:button}} Mouse}}|link={{{link|Controls Menu#Default Keybindings}}}]]}}<!--
| 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}}
Keyboard Keys:
|playstation 3
-->{{#ifeq:{{#var:inputmethod}}|keyboard|{{#vardefine:key|{{#switch:{{lc:{{{2|{{{1}}}}}}}}
|ps3=PS3
| zero | 0 = 0
|ps
| one | 1 = 1
|playstation
| two | 2 = 2
|playstation 4
| three | 3 = 3
|ps4=PS4
| four | 4 = 4
|psmove
| five | 5 = 5
|move=PSMove
| six | 6 = 6
|xbox360
| seven | 7 = 7
|360=360
| eight | 8 = 8
|gesture=Gesture
| nine | 9 = 9
|keyboard
| ten | 10 = 10
|mouse=Keyboard
| eleven | 11 = 11
|oculus=Oculus
| twelve | 12 = 12
|remote=Remote
| a = A
|steam=Steam
| alt | left alt | lalt | right alt | ralt = Alt
|switch=Switch
| down = Arrow Down
|vita=Vita
| left = Arrow Left
|vive=Vive
| right = Arrow Right
|wii=Wii
| up = Arrow Up
|wiiu=WiiU
| asterisk | * = Asterisk
|xbox
| b = B
|xbox one
| backspace | bksp = Backspace{{#if:{{{alt|}}}|_Alt}}
|xboxone
| [ | left bracket | lbracket = Bracket Left
|xbone
| ] | right bracket | rbracket = Bracket Right
|xbox1=XboxOne
| c = C
|ouya=Ouya
| caps lock | caps = Caps Lock
|undefined}}<!--
| com | cmd | command = Command
 
| control | ctrl | left control | left ctrl | lctrl | right control | right ctrl | rctrl = Ctrl
-->{{#ifeq:{{#var:console}}|mouse|{{#switch: {{lc:{{{variant}}}}}
| d = D
|dark=_White_Mouse_
| del | delete = Del
|light=_Black_Mouse_
| e = E
|#default = _White_Mouse_
| end = End
}}}} {{#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
| enter | return = Enter{{#if:{{{alt|}}}|_Alt|{{#if:{{{tall|}}}|_Tall}}}}
 
| esc | escape = Esc
The following handles the keyboard keys display
| f = F
 
| f1 = F1
-->{{#if: {{#var:keyboard}} | <span class="key">[[Controls|<kbd class="{{#switch: {{lc:{{{keyboardvariant}}}}} |dark=keysDark|light=keysLight|keysDark}}"><!--
| f2 = F2
 
| f3 = F3
-->{{#switch:{{#var:keyboard}}
| f4 = F4
 
| f5 = F5
<!--Standard keyboard values-->
| f6 = F6
|caps lock = ⇪ Caps Lock
| f7 = F7
|shift = ⇧ Shift
| f8 = F8
|lshift
| f9 = F9
|left shift = ⇧ Left Shift
| f10 = F10
|rshift
| f11 = F11
|right shift = ⇧ Right Shift
| f12 = F12
|return = ↵ Return
| fn | function = Function
|enter = ↵ Enter
| g = G
|esc = Esc
| h = H
|ctrl = Ctrl
| home = Home
|lctrl
| i = I
|left ctrl = Left Ctrl
| ins | insert = Insert
|rctrl
| j = J
|right ctrl = Right Ctrl
| k = K
|alt = Alt
| l = L
|lalt
| m = M
|left alt = Left Alt
| < | mark left | less than | less | lt = Mark Left
|ralt
| > | mark right | greater than | greater | gt = Mark Right
|right alt = Right Alt
| - | minus = Minus
|cmd = ⌘ Cmd
| n = N
|command = ⌘ Command
| num lock = Num Lock
|opt
| o = O
|option = ⌥ Option
| p = P
|tab = Tab ↹
| page down | pg down | pgdown = Page_Down
|backspace = ← Backspace
| page up | pg up | pgup = Page_Up
|space = Spacebar
| + | plus = Plus{{#if:{{{tall|}}}|_Tall}}
|super = ⊞ Super
| print screen | print | prt scrn | prtscrn = Print Screen
|menu = ≣ Menu
| q = Q
|windows = ⊞ Windows
| ? | question | question mark = Question
|up =
| " | quote | quotation marks | quotes | quotation mark = Quote
|down =
| r = R
|left =
| s = S
|right =
| ; | semicolon = Semicolon
|#default = {{ucfirst:{{#var:keyboard}}}}
| shift | left shift | right shift | lshift | rshift = Shift{{#if:{{{alt|}}}|_Alt}}
}}</kbd>]]</span>
| \ | backslash | back slash | slash = Slash
}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>
| &nbsp; | space | spacebar | space bar = Space
 
| t = T
<!--
| tab = Tab
| ~ | tilde | tilda | grave = Tilda
| u = U
| v = V
| w = W
| win | windows = Win
| x = X
| y = Y
| z = Z
}}}}[[File:{{#var:key}} Key {{ucfirst:{{{theme|Dark}}}}}.png|x{{{size|28px}}}|{{#var:key}}|link={{{link|Controls Menu#Default Keybindings}}}]]}}</onlyinclude></includeonly>

Latest revision as of 19:59, 16 November 2023

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}}

  • left, middle, right and none are accepted, giving respectively: Left Mouse, Middle Mouse, Right Mouse and

Example

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

produces:
Press Alt and F4 at the same time.

Themes

Light: Space Dark: Space

Mouse Buttons

Default theme: Light
Left MouseMiddle MouseRight Mouse

Keyboard Keys

Default theme: Dark

Numbers

0123456789

Letters & Punctuation

ABCDEFGHIJKLMNOPQRSTUVWXYZ
AsteriskBracket LeftBracket RightMark LeftMark RightMinusPlusQuestionQuoteSemicolonSlashSpaceTilda

Special

AltArrow DownArrow LeftArrow RightArrow UpBackspaceCaps LockCommandCtrlDelEndEnterEscHomeInsertNum LockPage_DownPage_UpPrint ScreenShiftTabWin
F1F2F3F4F5F6F7F8F9F10F11F12

Alternate Models

Backspace_AltEnter_AltEnter_TallPlus_TallShift_Alt

Credit to "Nicolae 'Xelu' Berbece" of "Those Awesome Guys" for key images.