Controls/Control – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Template creation)
 
(Add some key formatting)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{lc:{{{1}}}}}
| {{#switch:{{lc:{{{1}}}}}
| mouse= {{Icon|mouse}}
| lmb
| lmb
| mousel= {{Icon|mouseL}}
| mousel= {{Icon|mouseL}}
Line 9: Line 10:
| rmb
| rmb
| mouser= {{Icon|mouseR}}
| mouser= {{Icon|mouseR}}
| #default= <span class="keyboard">{{ucFirst:{{{1}}}}}</span>
| #default= <span class="keyboard">{{#switch:{{lc:{{{1}}}}}
|escape= Esc
|enter= Enter &crarr;
|delete= Del
|backspace= &lArr;
|up= &uarr;
|down= &darr;
|left= &larr;
|right= &rarr;
|pageup= &#8607; PgUp
|pagedown= &#8609; PgDown
|control= Ctrl
|lctrl= Ctrl
|rctrl
|rcontrol= RCtrl
|ralt= AltGr
|shift= &#8679; Shift
|rshift= RShift &#8679;
|tabulation= &#8633; Tab
|lwin
|windows= &#8862; Win
|rwin
|rwindows= RWin &#8862;
|num0= NUM 0
|num1= NUM 1
|num2= NUM 2
|num3= NUM 3
|num4= NUM 4
|num5= NUM 5
|num6= NUM 6
|num7= NUM 7
|num8= NUM 8
|num9= NUM 9
|num/= NUM /
|num*= NUM *
|num-= NUM -
|num+= NUM +
|num.= NUM .
|numenter= NUM Enter &crarr;
|#default= {{ucFirst:{{{1}}}}}
}}</span>
}}
}}
|-no key defined-{{TemplateCase||[[Category:Controls template usage error]]}}
|-no key defined-{{TemplateCase||[[Category:Controls template usage error]]}}
Line 15: Line 56:
|descr= Displays a keyboard key or a mouse icon — used by {{Template|Controls}}. It also adds the page to the [[:Category:Controls template usage error|Controls template usage error]] category on usage error.
|descr= Displays a keyboard key or a mouse icon — used by {{Template|Controls}}. It also adds the page to the [[:Category:Controls template usage error|Controls template usage error]] category on usage error.
|param1= control
|param1= control
|descr1= can be one of (case-insensitive for mouse icons):
|descr1= can be one of:
** mouseL or LMB
** mouse icon (case-insensitive):
** mouseL2 or LMB2
*** mouse
** mouseR or RMB
*** mouseL or LMB
** mouseM or MMB
*** 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 {{hl|ctrL}} will become {{hl|CtrL}})
** anything else for a keyboard key - the first letter will be capitalised (e.g {{hl|ctrL}} will become {{hl|CtrL}})
|example1= <nowiki>{{Controls/Control}}</nowiki>
|example1= <nowiki>{{Controls/Control}}</nowiki>
Line 29: Line 85:
|example4= <nowiki>{{Controls/Control|a}}</nowiki>
|example4= <nowiki>{{Controls/Control|a}}</nowiki>
|result4= {{Controls/Control|a}}
|result4= {{Controls/Control|a}}
|example5= <nowiki>{{Controls/Control|LMB}}</nowiki>
|example5= <nowiki>{{Controls/Control|LMB}}{{Controls/Control|RMB}}{{Controls/Control|LMB2}}{{Controls/Control|MMB}}{{Controls/Control|LMB}}</nowiki>
|result5= {{Controls/Control|LMB}}
|result5= {{Controls/Control|LMB}}
|example6= <nowiki>{{Controls|escape}}{{Controls|enter}}{{Controls|delete}}{{Controls|backspace}}{{Controls|up}}{{Controls|down}}{{Controls|left}}{{Controls|right}}{{Controls|pageup}}{{Controls|pagedown}}</nowiki>
|result6= {{Controls|escape}}{{Controls|enter}}{{Controls|delete}}{{Controls|backspace}}{{Controls|up}}{{Controls|down}}{{Controls|left}}{{Controls|right}}{{Controls|pageup}}{{Controls|pagedown}}
|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}}
|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>
|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}}
}}</noinclude>
}}</noinclude>

Revision as of 14:22, 17 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|LMB}}{{Controls/Control|RMB}}{{Controls/Control|LMB2}}{{Controls/Control|MMB}}{{Controls/Control|LMB}} Left 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|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}} NUM 0NUM 1NUM 2NUM 3NUM 4NUM 5NUM 6NUM 7NUM 8NUM 9NUM 9NUM /NUM *NUM -NUM +NUM .NUM Enter ↵