Template:Key press: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (moved Template to Template:Key press: I definitively got that on the wrong page.)
(+- doc: +- Using templates Obr and Cbr, + Example of table using the "keytable" CSS style class)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span style="border: 1px solid #777; padding: 1px 3px; font-family: inherit; font-size: 0.85em;">{{{1}}}</span><noinclude>
{{key press/core|{{{1|}}}}}<!--
-->{{#if:{{{2|}}}|{{{chain first|{{{chain|+}}}}}}{{key press/core|{{{2}}}}}}}<!--
-->{{#if:{{{3|}}}|{{{chain second|{{{chain|+}}}}}}{{key press/core|{{{3}}}}}}}<!--
-->{{#if:{{{4|}}}|{{{chain third|{{{chain|+}}}}}}{{key press/core|{{{4}}}}}}}<!--
-->{{#if:{{{5|}}}|{{{chain fourth|{{{chain|+}}}}}}{{key press/core|{{{5}}}}}}}<!--
-->{{#if:{{{6|}}}|{{{chain fifth|{{{chain|+}}}}}}{{key press/core|{{{6}}}}}}}<!--
-->{{#if:{{{7|}}}|{{{chain sixth|{{{chain|+}}}}}}{{key press/core|{{{7}}}}}}}<!--
-->{{#if:{{{8|}}}|{{{chain seventh|{{{chain|+}}}}}}{{key press/core|{{{8}}}}}}}<!--
-->{{#if:{{{9|}}}|{{{chain eighth|{{{chain|+}}}}}}{{key press/core|{{{9}}}}}}}<!--
-->{{#if:{{{10|}}}|{{{chain ninth|{{{chain|+}}}}}}{{key press/core|{{{10}}}}}}}<noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template inserts an inline key cap with a key caption.
This template is used to illustrate key presses. Optionally, a combination of up to ten keys can be used.


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''key press'''<nowiki>|</nowiki>''caption''<nowiki>}}</nowiki>
  {{obr}}'''key press'''{{!}}''key''{{!}}''key''{{!}}''key''{{!}}''key''{{cbr}}
 
For upper-case letters please use a combination of the shift key and an upper-case letter (<code>{{obr}}key press{{!}}Shift{{!}}C{{cbr}}</code>) and  for lower-case letters please use an upper-case letter (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>C<nowiki>}}</nowiki></code>).


In some cases workarounds will be required. One of them are for example the caption <span style="border: 1px solid #777; padding: 1px 3px; font-family: inherit; font-size: 0.85em;">{{!}}</span> which would require you to insert <code><nowiki>{{!}}</nowiki></code> instead of <code>{{!}}</code>, since using a "{{!}}" inside a template will break it.
== Examples ==
== Examples ==
  The key combination <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Ctrl<nowiki>}}</nowiki>+<nowiki>{{</nowiki>key press<nowiki>|</nowiki>Alt<nowiki>}}</nowiki>+<nowiki>{{</nowiki>key press<nowiki>|</nowiki>Del<nowiki>}}</nowiki> is sometimes called "The Vulcan neck-pinch".
  {{obr}}key press{{!}}G{{cbr}} and {{obr}}key press{{!}}Shift{{!}}G{{cbr}} will retract and extend the landing gear.
 
{{key press|G}} and {{key press|Shift|G}} will retract and extend the landing gear.
 
 
<nowiki>{| class="keytable"
! Key
! Function
|-
| {{key press|Shift|C}}
| Catapult launch command
|-
| {{key press|Shift|L}}
| Carrier launch-bar engage
|-
| {{key press|O}} / {{key press|Shift|O}}
| Hook up/down
|-
| {{key press|Ctrl|B}}
| Toggle airbrakes
|-
| {{key press|Ctrl|K}}
| Toggle spoilers
|}</nowiki>
 
{{{!}} class="keytable"
! Key
! Function
{{!-}}
{{!}} {{key press|Shift|C}}
{{!}} Catapult launch command
{{!-}}
{{!}} {{key press|Shift|L}}
{{!}} Carrier launch-bar engage
{{!-}}
{{!}} {{key press|O}} / {{key press|Shift|O}}
{{!}} Hook up/down
{{!-}}
{{!}} {{key press|Ctrl|B}}
{{!}} Toggle airbrakes
{{!-}}
{{!}} {{key press|Ctrl|K}}
{{!}} Toggle spoilers
{{!}}}
 
== Known issues ==
* For some captions workarounds will be required. Two of them are for example the captions {{key press|{{!}}}} and {{key press|{{=}}}} which would require you to insert <code><nowiki>{{!}}</nowiki></code> or  <code><nowiki>{{=}}</nowiki></code> instead of <code>{{!}}</code> or <code>{{=}}</code>, since using a "{{!}}" or "{{=}}" inside a template will break it.


The key combination <span style="border: 1px solid #777; padding: 1px 3px; font-family: inherit; font-size: 0.85em;">Ctrl</span>+<span style="border: 1px solid #777; padding: 1px 3px; font-family: inherit; font-size: 0.85em;">Alt</span>+<span style="border: 1px solid #777; padding: 1px 3px; font-family: inherit; font-size: 0.85em;">Del</span> is sometimes called "The Vulcan neck-pinch".
* If a line breaks right before the template the leftmost key border stays on that line.


[[Category:Templates]]
[[Category:Formatting templates]]
}}
}}
</noinclude>
</noinclude>

Latest revision as of 12:37, 22 August 2019

The following template description is not displayed when the template is inserted in an article.

Goal

This template is used to illustrate key presses. Optionally, a combination of up to ten keys can be used.

Usage

{{key press|key|key|key|key}}

For upper-case letters please use a combination of the shift key and an upper-case letter ({{key press|Shift|C}}) and for lower-case letters please use an upper-case letter ({{key press|C}}).

Examples

{{key press|G}} and {{key press|Shift|G}} will retract and extend the landing gear.

G and Shift+G will retract and extend the landing gear.


{| class="keytable"
! Key
! Function
|-
| {{key press|Shift|C}}
| Catapult launch command
|-
| {{key press|Shift|L}}
| Carrier launch-bar engage
|-
| {{key press|O}} / {{key press|Shift|O}}
| Hook up/down
|-
| {{key press|Ctrl|B}}
| Toggle airbrakes
|-
| {{key press|Ctrl|K}}
| Toggle spoilers
|}
Key Function
Shift+C Catapult launch command
Shift+L Carrier launch-bar engage
O / Shift+O Hook up/down
Ctrl+B Toggle airbrakes
Ctrl+K Toggle spoilers

Known issues

  • For some captions workarounds will be required. Two of them are for example the captions | and = which would require you to insert {{!}} or {{=}} instead of | or =, since using a "|" or "=" inside a template will break it.
  • If a line breaks right before the template the leftmost key border stays on that line.