Controls/Control – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix example)
(Add controllers, Change CSS class)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{lc:{{{1}}}}}
| {{#switch:{{lc:{{{1}}}}}
| mouse= {{Icon|mouse}}
| mouse= {{Icon|mouse}}
| lmb
| lmb
Line 10: Line 11:
| rmb
| rmb
| mouser= {{Icon|mouseR}}
| mouser= {{Icon|mouseR}}
| #default= <span class="keyboard">{{#switch:{{lc:{{{1}}}}}
 
| pada
| padb
| padx
| pady
| padlb
| padlt
| padlsb
| padrb
| padrt
| padrsb
 
| padcross
| padcircle
| padsquare
| padtriangle
| padl1
| padl2
| padl3
| padr1
| padr2
| padr3
 
| padback
| padstart
| padup
| paddown
| padleft
| padright= {{#switch:{{lc:{{{1}}}}}
|pada= <span class="control-pad-green">A</span>
|padb= <span class="control-pad-red">B</span>
|padx= <span class="control-pad-blue">X</span>
|pady= <span class="control-pad-yellow">Y</span>
|padcross= <span class="control-pad-blue">&#10006;</span>
|padcircle= <span class="control-pad-red">&#9711;</span>
|padsquare= <span class="control-pad-pink">&#11036;</span>
|padtriangle= <span class="control-pad-green">&#9651;</span>
|padback= <span class="control-pad-white">back</span>
|padstart= <span class="control-pad-white">start/span>
|padup= <span class="control-pad">&uarr;</span>
|paddown= <span class="control-pad">&darr;</span>
|padleft= <span class="control-pad">&larr;</span>
|padright= <span class="control-pad">&rarr;</span>
|#default= <span class="control-pad">{{uc:{{#sub:{{{1}}}|3}}}}</span>
}}
 
| #default= <span class="control-keyboard-key">{{#switch:{{lc:{{{1}}}}}
|escape= Esc
|escape= Esc
|enter= Enter &crarr;
|enter= Enter &crarr;
Line 92: Line 139:
|example7= <nowiki>{{Controls|control}}{{Controls|lctrl}}{{Controls|rctrl}}{{Controls|rcontrol}}{{Controls|ralt}}{{Controls|shift}}{{Controls|rshift}}{{Controls|tabulation}}{{Controls|lwin}}{{Controls|windows}}{{Controls|rwin}}{{Controls|rwindows}}</nowiki>
|example7= <nowiki>{{Controls|control}}{{Controls|lctrl}}{{Controls|rctrl}}{{Controls|rcontrol}}{{Controls|ralt}}{{Controls|shift}}{{Controls|rshift}}{{Controls|tabulation}}{{Controls|lwin}}{{Controls|windows}}{{Controls|rwin}}{{Controls|rwindows}}</nowiki>
|result7= {{Controls|control}}{{Controls|lctrl}}{{Controls|rctrl}}{{Controls|rcontrol}}{{Controls|ralt}}{{Controls|shift}}{{Controls|rshift}}{{Controls|tabulation}}{{Controls|lwin}}{{Controls|windows}}{{Controls|rwin}}{{Controls|rwindows}}
|result7= {{Controls|control}}{{Controls|lctrl}}{{Controls|rctrl}}{{Controls|rcontrol}}{{Controls|ralt}}{{Controls|shift}}{{Controls|rshift}}{{Controls|tabulation}}{{Controls|lwin}}{{Controls|windows}}{{Controls|rwin}}{{Controls|rwindows}}
|example8= <nowiki>{{Controls|num0}}{{Controls|num1}}{{Controls|num2}}{{Controls|num3}}{{Controls|num4}}{{Controls|num5}}{{Controls|num6}}{{Controls|num7}}{{Controls|num8}}{{Controls|num9}}{{Controls|num9}}{{Controls|num/}}{{Controls|num*}}{{Controls|num-}}{{Controls|num+}}{{Controls|num.}}{{Controls|numenter}}</nowiki>
|example8= <nowiki/>
|result8= {{Controls|num0}}{{Controls|num1}}{{Controls|num2}}{{Controls|num3}}{{Controls|num4}}{{Controls|num5}}{{Controls|num6}}{{Controls|num7}}{{Controls|num8}}{{Controls|num9}}{{Controls|num9}}{{Controls|num/}}{{Controls|num*}}{{Controls|num-}}{{Controls|num+}}{{Controls|num.}}{{Controls|numenter}}
<nowiki>{{Controls|num/}}{{Controls|num*}}{{Controls|num-}}{{Controls|num+}}</nowiki><br>
<nowiki>{{Controls|num7}}{{Controls|num8}}{{Controls|num9}}</nowiki><br>
<nowiki>{{Controls|num4}}{{Controls|num5}}{{Controls|num6}}</nowiki><br>
<nowiki>{{Controls|num1}}{{Controls|num2}}{{Controls|num3}}</nowiki><br>
<nowiki>{{Controls|num0}}{{Controls|num.}}{{Controls|numenter}}</nowiki>
|result8= <nowiki/>
{{Controls|num/}}{{Controls|num*}}{{Controls|num-}}{{Controls|num+}}<br>
{{Controls|num7}}{{Controls|num8}}{{Controls|num9}}<br>
{{Controls|num4}}{{Controls|num5}}{{Controls|num6}}<br>
{{Controls|num1}}{{Controls|num2}}{{Controls|num3}}<br>
{{Controls|num0}}{{Controls|num.}}{{Controls|numenter}}
 
|example9= <nowiki/>
<nowiki>{{Controls|padA}}{{Controls|padB}}{{Controls|padX}}{{Controls|padY}}</nowiki><br>
<nowiki>{{Controls|padcross}}{{Controls|padcircle}}{{Controls|padsquare}}{{Controls|padtriangle}}</nowiki>
|result9= <nowiki/>
{{Controls|padA}}{{Controls|padB}}{{Controls|padX}}{{Controls|padY}}<br>
{{Controls|padcross}}{{Controls|padcircle}}{{Controls|padsquare}}{{Controls|padtriangle}}<br>
 
}}</noinclude>
}}</noinclude>

Revision as of 12:37, 28 June 2022

Displays a keyboard key or a mouse icon — used by {{Controls}}. It also adds the page to the Controls template usage error category on usage error.

This template is used on these pages.

Usage

{{Controls/Control|control}}

  • control: can be one of:
    • mouse icon (case-insensitive):
      • mouse
      • mouseL or LMB
      • mouseL2 or LMB2
      • mouseR or RMB
      • mouseM or MMB
    • pre-formatted key:
      • escape / enter / delete / backspace
      • up / down / left / right
      • pageup / pagedown
      • control / lctrl
      • rctrl / rcontrol
      • ralt
      • shift
      • rshift
      • tabulation
      • lwin / windows
      • rwin / rwindows
      • num0..9 / num/ / num* / num- / num+ / num. / numenter
    • anything else for a keyboard key - the first letter will be capitalised (e.g ctrL will become CtrL)
Examples
Code Result
{{Controls/Control}} -no key defined-
{{Controls/Control|ctrl}} Ctrl
{{Controls/Control|Ctrl}} Ctrl
{{Controls/Control|a}} A
{{Controls/Control|mouse}}{{Controls/Control|LMB}}{{Controls/Control|LMB2}}{{Controls/Control|MMB}}{{Controls/Control|RMB}} MouseLeft Mouse ButtonDouble Left Mouse ButtonMiddle Mouse ButtonRight Mouse Button
{{Controls|escape}}{{Controls|enter}}{{Controls|delete}}{{Controls|backspace}}{{Controls|up}}{{Controls|down}}{{Controls|left}}{{Controls|right}}{{Controls|pageup}}{{Controls|pagedown}} EscEnter ↵Del↟ PgUp↡ PgDown
{{Controls|control}}{{Controls|lctrl}}{{Controls|rctrl}}{{Controls|rcontrol}}{{Controls|ralt}}{{Controls|shift}}{{Controls|rshift}}{{Controls|tabulation}}{{Controls|lwin}}{{Controls|windows}}{{Controls|rwin}}{{Controls|rwindows}} CtrlCtrlRCtrlRCtrlAltGr⇧ ShiftRShift ⇧↹ Tab⊞ Win⊞ WinRWin ⊞RWin ⊞

{{Controls|num/}}{{Controls|num*}}{{Controls|num-}}{{Controls|num+}}
{{Controls|num7}}{{Controls|num8}}{{Controls|num9}}
{{Controls|num4}}{{Controls|num5}}{{Controls|num6}}
{{Controls|num1}}{{Controls|num2}}{{Controls|num3}}
{{Controls|num0}}{{Controls|num.}}{{Controls|numenter}}

NUM /NUM *NUM -NUM +
NUM 7NUM 8NUM 9
NUM 4NUM 5NUM 6
NUM 1NUM 2NUM 3
NUM 0NUM .NUM Enter ↵

{{Controls|padA}}{{Controls|padB}}{{Controls|padX}}{{Controls|padY}}
{{Controls|padcross}}{{Controls|padcircle}}{{Controls|padsquare}}{{Controls|padtriangle}}

ABXY