Template:Key press/doc: Difference between revisions

m 1 revision imported
Started correcting documentation
Line 1: Line 1:
{{Documentation subpage}}
{{Redirect|Template:Key|map key templates|Category:Legend templates}}
{{Lua|Module:Key}}
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE END OF THIS PAGE. -->
__NOTOC__
__NOTOC__


Line 8: Line 4:


Example
Example
: {{tc|key press|A}} → {{key press|A}}
: <nowiki>{{key press|A}}</nowiki> → {{key press|A}}


===Keystroke combinations===
===Keystroke combinations===
To illustrate keystroke combinations, just use extra parameters:
To illustrate keystroke combinations, just use extra parameters:
: {{tc|key press|Alt|P}} → {{key press|Alt|P}}
: <nowiki>{{key press|Alt|P}}</nowiki> → {{key press|Alt|P}}
: {{tc|key press|Ctrl|Alt|Del}} → {{key press|Ctrl|Alt|Del}}
: <nowiki>{{key press|Ctrl|Alt|Del}}</nowiki> → {{key press|Ctrl|Alt|Del}}


When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional ''chain'' parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table then that might cause too wide items. Then instead manually build the key combination with spaces around the "+" so it can line wrap:
When you feed several key names to this template, it adds a "+" (or whatever the contents of the optional ''chain'' parameter) with no spaces around. This means it won't line wrap. But when you show key combinations for instance in a table then that might cause too wide items. Then instead manually build the key combination with spaces around the "+" so it can line wrap:
: {{tc|key press|Ctrl}} + {{tlc|key press|Alt}} + {{tlc|key press|Del}} → {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}
: <nowiki>{{key press|Ctrl}}</nowiki> + <nowiki>{{key press|Alt}}</nowiki> + <nowiki>{{key press|Del}}</nowiki> → {{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}}
: {{tc|key press|Ctrl|Alt|Del|5=chain=&amp;#32;+&amp;#32;}} → {{key press|Ctrl|Alt|Del|chain=&#32;+&#32;}}
: <nowiki>{{key press|Ctrl|Alt|Del|5=chain=&amp;#32;+&amp;#32;}}</nowiki> → {{key press|Ctrl|Alt|Del|chain=&#32;+&#32;}}


On the other hand, to illustrate Windows [[Alt code]]s you might want to use separate templates with no intervening punctuation or space. In most Windows systems in North America and Western Europe, for example, the [[plus-minus sign]] (±) can be entered by holding down the Alt key while typing <code>0177</code> (with the [[numeric keypad]]):
On the other hand, to illustrate Windows [[Alt code]]s you might want to use separate templates with no intervening punctuation or space. In most Windows systems in North America and Western Europe, for example, the [[plus-minus sign]] (±) can be entered by holding down the Alt key while typing <code>0177</code> (with the [[numeric keypad]]):