Difference between revisions of "Template:Key"
Jump to navigation
Jump to search
(Created page with "<span style="font-size: small; border: 0.2em solid; border-color: #DDD #BBB #BBB #DDD; padding: 0 0.4em; background: #EEE; white-space: nowrap; border-radius: 2px;">{{ucfirst:...") |
Tag: Undo |
||
(8 intermediate revisions by 5 users not shown) | |||
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 | ||
+ | | lstick = Left Stick | ||
+ | | rightstick | ||
+ | | right stick | ||
+ | | rstick = Right Stick | ||
+ | | lt = LT | ||
+ | | lb = LB | ||
+ | | rt = RT | ||
+ | | rb = RB | ||
+ | | l = Left | ||
+ | | r = Right | ||
+ | | u = Up | ||
+ | | d = Down | ||
+ | | m = Menu | ||
+ | | o = Circle | ||
+ | | touchpad = Touch Pad | ||
+ | | #default = {{ucfirst:{{#if:{{{key|}}}|{{{key}}}|{{{2}}}}}}} | ||
+ | }}}}<!-- | ||
+ | -->{{#vardefine:keyboard|{{lc:{{#if:{{{keyboard|}}}|{{{keyboard}}}|{{#if:{{{2|}}}||{{{1|}}}}}}}}}}}<!-- | ||
− | == | + | -->{{#if: {{#var:console}} | [[File:{{#switch: {{#var:console}} |
− | + | |ps3=PS3 | |
+ | |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 | ||
+ | |xboxone | ||
+ | |xbone | ||
+ | |xbox1=XboxOne | ||
+ | |ouya=Ouya | ||
+ | |undefined}}<!-- | ||
− | [[ | + | -->{{#ifeq:{{#var:console}}|mouse|{{#switch: {{lc:{{{variant}}}}} |
− | </noinclude> | + | |dark=_White_Mouse_ |
+ | |light=_Black_Mouse_ | ||
+ | |#default = _Black_Mouse_ | ||
+ | }}}} {{#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|keysLight}}"><!-- | ||
+ | |||
+ | -->{{#switch:{{#var:keyboard}} | ||
+ | |||
+ | <!--Standard keyboard values--> | ||
+ | |caps lock = ⇪ Caps Lock | ||
+ | |shift = ⇧ Shift | ||
+ | |lshift | ||
+ | |left shift = ⇧ Left Shift | ||
+ | |rshift | ||
+ | |right shift = ⇧ Right Shift | ||
+ | |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 | ||
+ | |super = ⊞ Super | ||
+ | |menu = ≣ Menu | ||
+ | |windows = ⊞ Windows | ||
+ | |||
+ | |#default = {{uc:{{#var:keyboard}}}} | ||
+ | }}</kbd>]]</span> | ||
+ | }}</includeonly><noinclude>{{documentation}}</noinclude> |
Latest revision as of 03:40, 2 February 2023
This page has been suggested for recoding. Reason: It'd be really nice if the template actually supported the console options it claims too, specifically the ones added by Console edition and steam deck too.. You can help RimWorld Wiki by improving it. |
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[edit]
- Note: For a summary of possible console, key, and button values, see Template:Key/library.
Keyboard[edit]
{{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 todark
, rendering a white key with black text. Enterdark
for dark wikis, orlight
for light wikis.
Controller[edit]
{{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[edit]
Keyboard[edit]
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.
{{key | keyboard = caps lock | keyboardvariant = dark }}
Or for light wikis:
{{key | keyboard = caps lock | keyboardvariant = light }}
Keyboard keys can be entered in shorthand like this: ⇪ Caps Lock
{{key|caps lock}}
The above documentation is transcluded from Template:Key/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |