Template:Key press: Difference between revisions

Jump to navigation Jump to search
m
Updated the documentation
(Trying to make it take combinations, e.g. Ctrl+A)
m (Updated the documentation)
Line 3: Line 3:
__NOTOC__
__NOTOC__
== Goal ==
== Goal ==
This template inserts an inline key cap with a key caption.
This template inserts an inline key cap with a key caption. 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>''caption''<nowiki>|</nowiki>''caption''<nowiki>|</nowiki>''caption''<nowiki>|</nowiki>''caption''<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>).


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.
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 ==
  The key combination <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Ctrl<nowiki>|</nowiki>Alt<nowiki>|</nowiki>Del<nowiki>}}</nowiki> is sometimes called "The Vulcan neck-pinch", and <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Ctrl<nowiki>|</nowiki>A<nowiki>}}</nowiki> usually turns on the autopilot.
  <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.


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.
{{key press|G}} and {{key press|Shift|G}} will retract and extend the landing gear.


== Known issues ==
== Known issues ==
Line 19: Line 21:
== To do ==
== To do ==
Add <s>functionality</s> template magic so that:
Add <s>functionality</s> template magic so that:
  <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Ctrl<nowiki>|</nowiki>Alt<nowiki>|</nowiki>Del<nowiki>}}</nowiki>, <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Shift<nowiki>|</nowiki>A<nowiki>}}</nowiki> and <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Alt<nowiki>|</nowiki>0<nowiki>|</nowiki>1<nowiki>|</nowiki>7<nowiki>|</nowiki>6<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>key press<nowiki>|</nowiki>Alt<nowiki>|</nowiki>0<nowiki>|</nowiki>1<nowiki>|</nowiki>7<nowiki>|</nowiki>6<nowiki>}}</nowiki>
Would render {{key press|Ctrl}}+{{key press|Alt}}+{{key press|Del}}, {{key press|Shift}}+{{key press|A}} and {{key press|Alt}}+{{key press|0}}{{key press|1}}{{key press|7}}{{key press|6}} (the last ''might'' not be possible).
Would render {{key press|Alt}}+{{key press|0}}{{key press|1}}{{key press|7}}{{key press|6}} (''Might'' not be possible).


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

Navigation menu