×
Create a new article
Write your page title here:
We currently have 3,089 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,089Articles

Template:Control: Difference between revisions

(adapted from https://minecraft.wiki/w/Template:Control)
 
(add show_set and directional)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude><div class="center"></noinclude><span class="explain" tabindex="0" title="{{#switch: {{lc:{{{1<noinclude>|interact</noinclude>}}}}}
<noinclude><div class="center"></noinclude>{{#ifeq:{{{2|}}}|show_set||<span class="explain" tabindex="0" title="}}{{#switch: {{lc:{{{1<noinclude>|interact</noinclude>}}}}}
|interact = Z / Space / Enter
|interact|action = Z / Space / Enter
|menu = X / C / V / B / N / Esc
|menu = X / C / V / B / N / Esc / Numpad 0
}}">{{{2|{{{1<noinclude>|interact</noinclude>}}}}}}</span><noinclude></div>
|up|up arrow = Up arrow / Numpad 8 / K
|right|right arrow = Right arrow / Numpad 6 / L
|down|down arrow = Down arrow / Numpad 2 / J
|left|left arrow = Left arrow / Numpad 4 / H
|directional = Arrow keys / Numpad 2 4 6 8 / HJKL
|#default = No alternative keys
}}{{#ifeq:{{{2|}}}|show_set||">{{{2|{{{1<noinclude>|interact</noinclude>}}}}}}</span>}}<noinclude></div>


Use this template for controls to include a tooltip of keys that map to that control by default.
Use this template for controls to include a tooltip of keys that map to that control by default.
Line 30: Line 36:
Technically it's still possible to put a specific key in the second parameter and display something like "Hold {{control|menu|esc}}", but this is more confusing.
Technically it's still possible to put a specific key in the second parameter and display something like "Hold {{control|menu|esc}}", but this is more confusing.


The special value {{para|2|show_set}} outputs the keys as text instead of in a tooltip:
<code><nowiki>Use the {{control|directional|show_set}} keys to move.</nowiki></code>
<code>Use the {{control|directional|show_set}} keys to move.</code>
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 15:53, 13 December 2024

interact

Use this template for controls to include a tooltip of keys that map to that control by default.

For example, instead of writing:

Hold X to exit the screen.

You should instead write:

Hold the {{control|menu}} key to exit the screen.

Which would present:

Hold the menu key to exit the screen.

Alternatively, you could write:

Hold the {{control|menu|menu key}} to exit the screen.

Which would present:

Hold the menu key to exit the screen.

The purpose of this template is to avoid suggesting specific keys when in actuality a range of keys can be used.

Technically it's still possible to put a specific key in the second parameter and display something like "Hold esc", but this is more confusing.

The special value |2 = show_set outputs the keys as text instead of in a tooltip:

Use the {{control|directional|show_set}} keys to move.

Use the Arrow keys / Numpad 2 4 6 8 / HJKL keys to move.