Template:Key press/doc

From Summertime Saga Wiki
< Template:Key press
Revision as of 18:42, 21 July 2020 by Casiope (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The template {{key press}} is primarily designed to illustrate keys and keystrokes on a computer keyboard. With additional parameters, a single template can even illustrate a combination of multiple simultaneous keystrokes. A sequence of keystrokes, on the other hand, need to be demonstrated with separate templates.

Usage

{{key press|A}} produces A

Keystroke combinations

To illustrate keystroke combinations, just use extra parameters:

{{key press|Alt|P}} produces Alt+P
{{key press|Ctrl|Alt|Del}} produces 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 that might cause items to be too wide. Instead manually build the key combination with spaces around the “+” so it can line wrap:

{{key press|Ctrl}} + {{key press|Alt}} + {{key press|Del}} produces Ctrl + Alt + Del
{{key press|Ctrl|Alt|Del}} produces Ctrl + Alt + Del

To illustrate sequences where all keys do not need to be pressed simultaneously, the plus signs can be omitted by setting |chain=. For example, in most Windows systems in North America and Western Europe, Alt codes can be used to insert the plus-minus sign (±) by holding down the Alt key while typing 0177 with the numeric keypad:

{{key press|Alt|0}}{{key press|1|7|7|chain=}} produces Alt+0177

An example of a use case where more than five might be used is explaining usage of a macro (keyboard shortcut) created by a third-party application:

{{key press|Ctrl|Alt|Shift|Win|Menu|fn|L}} produces Ctrl+Alt+⇧ Shift+⊞ Win+≣ Menu+fn+L

Wiki markup characters

Some wiki markup characters, like the pipe symbol, the semicolon and the equals sign, need to be entered using the {{!}}, {{;}}, and {{=}} templates or as an HTML entity &amp;#124;, &amp;#59;, &amp;#61; respectively:

  • {{key press|&#124;}} produces |
  • {{key press|{{;}}}} produces ;
  • {{key press|&#59;}} produces ;
  • {{key press|{{=}}}} produces =
  • {{key press|&#61;}} produces =

Most markup characters also have aliases:

  • {{key press|pipe}} produces |
  • {{key press|semicolon}} produces ;
  • {{key press|equals}} produces =
  • {{key press|colon}} produces :
  • {{key press|asterisk}} produces *
  • {{key press|hash}} produces #

Key symbols

Some key names have a fitting Unicode character. This template automatically adds icons to the following key names among others.

  • {{key press|Shift}} produces ⇧ Shift
  • {{key press|Tab}} produces Tab ↹
  • {{key press|Enter}} produces ↵ Enter
  • {{key press|Option}} produces ⌥ Option
  • {{key press|Opt}} produces ⌥ Opt
  • {{key press|Command}} produces ⌘ Command
  • {{key press|Cmd}} produces ⌘ Cmd
  • {{key press|Caps Lock}} produces ⇪ Caps Lock
  • {{key press|Up}} produces
  • {{key press|Down}} produces
  • {{key press|Left}} produces
  • {{key press|Right}} produces

There are no characters for the Windows key and Menu key. So this template shows approximate characters for them, namely the “squared plus” and “strictly equivalent to” signs from the mathematical operators Unicode block:

  • {{key press|Win}} produces ⊞ Win
  • {{key press|Menu}} produces ≣ Menu

Directional input

The following should only be used when the input sequence uses something other than the primary input or mixes input between directional devices.

  • {{key press|l-down}} produces L↓
  • {{key press|r-left}} produces R←
  • {{key press|r-up}} produces R↑

Stick specific diagonals are also supported:

  • {{key press|l-nw}} produces L↖
  • {{key press|l-se}} produces L↘
  • {{key press|r-ne}} produces R↗

See also

  • {{summertimesaga button}} – produces a visual effect for Summertime Saga interface elements.
  • {{kbd}} – indicates user input (of any kind) without making it look like keys or buttons.