Controls – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Useful for displaying keyboard operations)
 
m (Fix parameters)
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}|<span class="keyboard">{{{1}}}</span>{{#if:{{{2|}}}|&#32;+ <span class="keyboard">{{{2}}}</span>{{#if:{{{3|}}}|&#32;+ <span class="keyboard">{{{3}}}</span>{{#if:{{{4|}}}|&#32;+ <span class="keyboard">{{{4}}}</span>|}}|}}|}}|}}</includeonly><noinclude>
<includeonly>{{#if:{{{1|}}}|<span class="keyboard">{{{1}}}</span>{{#if:{{{2|}}}|&#32;+ <span class="keyboard">{{{2}}}</span>{{#if:{{{3|}}}|&#32;+ <span class="keyboard">{{{3}}}</span>{{#if:{{{4|}}}|&#32;+ <span class="keyboard">{{{4}}}</span>|}}|}}|}}|-no keys defined-}}</includeonly><noinclude>{{Doc/Template
==Usage==
|descr= Shows a key-styled keyboard shortcut.
Useful for displaying keyboard operations ''e.g.''
|param1= key1
:Use <tt><nowiki>{{kb|Ctrl|Shift|T}}</nowiki></tt> to create {{kb|Ctrl|Shift|T}} where needed.
|descr1= first key
 
|param2= key2
Up to 4 keys may be specified.
|descr2= (Optional) second key
 
|param3= key3
<!-- Categories this template should belong to -->
|descr3= (Optional) third key
[[Category:Templates|{{uc:{{PAGENAME}}}}]]
|param4= key4
 
|descr4= (Optional) fourth key
</noinclude>
|example1= <nowiki>{{KeyboardShortcut}}</nowiki>
|result1= {{KeyboardShortcut}}
|example2= <nowiki>{{KeyboardShortcut|Ctrl}}</nowiki>
|result2= {{KeyboardShortcut|Ctrl}}
|example3= <nowiki>{{KeyboardShortcut|Ctrl|Shift|T}}</nowiki>
|result3= {{KeyboardShortcut|Ctrl|Shift|T}}
|example4= <nowiki>{{KeyboardShortcut|Ctrl|Alt|Shift|T}}</nowiki>
|result4= {{KeyboardShortcut|Ctrl|Alt|Shift|T}}
|example5= <nowiki>{{KeyboardShortcut|Ctrl|Alt|Shift|T|U}}</nowiki>
|result5= {{KeyboardShortcut|Ctrl|Alt|Shift|T|U}}
}}</noinclude>

Revision as of 18:57, 24 January 2021

Shows a key-styled keyboard shortcut.

This template is used on these pages.

Usage

{{Controls|key1|key2|key3|key4}}

  • key1: first key
  • key2: (Optional) second key
  • key3: (Optional) third key
  • key4: (Optional) fourth key
Examples
Code Result
{{KeyboardShortcut}} -no keys defined-
{{KeyboardShortcut|Ctrl}} Ctrl
{{KeyboardShortcut|Ctrl|Shift|T}} Ctrl + Shift + T
{{KeyboardShortcut|Ctrl|Alt|Shift|T}} Ctrl + Alt + Shift + T
{{KeyboardShortcut|Ctrl|Alt|Shift|T|U}} Ctrl + Alt + Shift + T