Template:Key press: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Cleanup, simplification)
(Rephrasing current intended use)
Line 8: Line 8:
  <nowiki>{{</nowiki>'''key press'''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<nowiki>|</nowiki>''key''<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 upper-case letters please use a combination of the shift key and an upper-case letter (<code><nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>C<nowiki>}}</nowiki></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 {{key press|{{!}}}} 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 ==
  <nowiki>{{</nowiki>key press<nowiki>|</nowiki>G<nowiki>}}</nowiki> and <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>G<nowiki>}}</nowiki> will retract and extend the landing gear.
  <nowiki>{{</nowiki>key press<nowiki>|</nowiki>G<nowiki>}}</nowiki> and <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>G<nowiki>}}</nowiki> will retract and extend the landing gear.
Line 17: Line 16:


== Known issues ==
== Known issues ==
This template currently wraps, so that for example {{key press|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.
* In some cases workarounds will be required. One of them are for example the caption {{key press|{{!}}}} which would require you to insert <code><nowiki>{{!}}</nowiki></code> instead of <code>{{!}}</code>, since using a "{{!}}" inside a template will break it.
 
* This template currently wraps, so that for example {{key press|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 ==
== To do ==

Revision as of 20:02, 29 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 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.

Known issues

  • 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.
  • 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).