Template:Key press: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Updated the documentation)
(Cleanup, simplification)
Line 3: Line 3:
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template inserts an inline key cap with a key caption. Optionally, a combination of up to four keys can be used.
This template is used to illustrate key presses. Optionally, a combination of up to four keys can be used.


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''key press'''<nowiki>|</nowiki>''caption''<nowiki>|</nowiki>''caption''<nowiki>|</nowiki>''caption''<nowiki>|</nowiki>''caption''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''key press'''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<nowiki>}}</nowiki>


For lowercase letters please use capital letters (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>C<nowiki>}}</nowiki></code>), and for uppercase letters a combination with the shift key (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>C<nowiki>}}</nowiki></code>).
For lowercase letters please use capital letters (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>C<nowiki>}}</nowiki></code>), and for uppercase letters a combination with the shift key (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>C<nowiki>}}</nowiki></code>).

Revision as of 20:13, 27 April 2013

{{{1}}}

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 four keys can be used.

Usage

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

For lowercase letters please use capital letters ({{key press|C}}), and for uppercase letters a combination with the shift key ({{key press|Shift|C}}).

In some cases workarounds will be required. One of them are for example the caption | which would require you to insert {{!}} instead of |, since using a "|" inside a template will break it.

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.

Known issues

This template currently wraps, so that for example Page up may end up having two half boxes with "Page" at the end of one line and "up" at the beginning of the following line.

To do

Add functionality template magic so that:

{{key press|Alt|0|1|7|6}}

Would render Alt+0176 (Might not be possible).