Controls – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add specific consoles support)
(Add console's fourth key)
Line 1: Line 1:
<includeonly>{{#switch:{{lc:{{{1}}}}}
<includeonly>{{#switch:{{lc:{{{1}}}}}
|xbox= {{#if:{{{2|}}}
|xbox= {{#if:{{{2|}}}
| {{Controls/Control|xbox|{{{2}}}}}{{#if:{{{3|}}}|&#32;+ {{Controls/Control|xbox|{{{3}}}}}{{#if:{{{4|}}}||&#32;+ {{Controls/Control|xbox|{{{4}}}}}}}}}
| {{Controls/Control|xbox|{{{2}}}}}{{#if:{{{3|}}}|&#32;+ {{Controls/Control|xbox|{{{3}}}}}{{#if:{{{4|}}}|&#32;+ {{Controls/Control|xbox|{{{4}}}}}{{#if:{{{5|}}}|&#32;+ {{Controls/Control|xbox|{{{5}}}}}}}}}}}
| -no Xbox controls defined-{{TemplateCase||[[Category:Controls template usage error]]}}
| -no Xbox controls defined-{{TemplateCase||[[Category:Controls template usage error]]}}
}}
}}
|dualshock
|dualshock
|playstation= {{#if:{{{2|}}}
|playstation= {{#if:{{{2|}}}
| {{Controls/Control|dualshock|{{{2}}}}}{{#if:{{{3|}}}|&#32;+ {{Controls/Control|dualshock|{{{3}}}}}{{#if:{{{4|}}}||&#32;+ {{Controls/Control|dualshock|{{{4}}}}}}}}}
| {{Controls/Control|dualshock|{{{2}}}}}{{#if:{{{3|}}}|&#32;+ {{Controls/Control|dualshock|{{{3}}}}}{{#if:{{{4|}}}|&#32;+ {{Controls/Control|dualshock|{{{4}}}}}{{#if:{{{5|}}}|&#32;+ {{Controls/Control|dualshock|{{{5}}}}}}}}}}}
| -no DualShock controls defined-{{TemplateCase||[[Category:Controls template usage error]]}}
| -no DualShock controls defined-{{TemplateCase||[[Category:Controls template usage error]]}}
}}
}}
Line 33: Line 33:
|param4= ctrl4
|param4= ctrl4
|descr4= (Optional) fourth control
|descr4= (Optional) fourth control
|param5= ctrl5
|descr5= (Optional) fourth console control


|example1= <nowiki>{{Controls}}</nowiki>
|example1= <nowiki>{{Controls}}</nowiki>

Revision as of 17:39, 29 June 2022

Shows a key-styled keyboard shortcut and/or a mouse button. It also adds the page to the Controls template usage error category on usage error.

  • Mouse button can be (case-insensitive):
    • mouseL or LMB
    • mouseL2 or LMB2
    • mouseR or RMB
    • mouseM or MMB
  • Keyboard key can be anything - the first letter will be capitalised, see {{Controls/Control}}.

This template is used on these pages.

Usage

{{Controls|ctrl1|ctrl2|ctrl3|ctrl4|ctrl5}}

  • ctrl1: first control - if xbox or dualshock/playstation (case-insensitive), all the following keys will be XBox- or PlayStation-stylised (see {{Controls/Control}})
  • ctrl2: (Optional) second control
  • ctrl3: (Optional) third control
  • ctrl4: (Optional) fourth control
  • ctrl5: (Optional) fourth console control
Examples
Code Result
{{Controls}} -no controls defined-
{{Controls|Ctrl}} Ctrl
{{Controls|Ctrl|LMB}} Ctrl + Left Mouse Button
{{Controls|Ctrl|Shift|T}} Ctrl + ⇧ Shift + T
{{Controls|Ctrl|Alt|Shift|T}} Ctrl + Alt + ⇧ Shift + T
{{Controls|Ctrl|Alt|Shift|T|U}} Ctrl + Alt + ⇧ Shift + T

{{Controls|Xbox|A|LT|start}}
{{Controls|dualshock|cross|L1|start}}
{{Controls|padA|padLT|padStart}}

+ +
Dualshock + Dualshock + Dualshock
+ +