Template:Key press

From FlightGear wiki
Revision as of 18:17, 27 April 2013 by Johan G (talk | contribs) (Trying to make it take combinations, e.g. Ctrl+A)
Jump to navigation Jump to search

{{{1}}}

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

Goal

This template inserts an inline key cap with a key caption.

Usage

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

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

The key combination {{key press|Ctrl|Alt|Del}} is sometimes called "The Vulcan neck-pinch", and {{key press|Ctrl|A}} usually turns on the autopilot.

The key combination Ctrl+Alt+Del is sometimes called "The Vulcan neck-pinch", and Ctrl+A usually turns on the autopilot.

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|Ctrl|Alt|Del}}, {{key press|Shift|A}} and {{key press|Alt|0|1|7|6}}

Would render Ctrl+Alt+Del, Shift+A and Alt+0176 (the last might not be possible).