[go: nahoru, domu]

跳转到内容

Template:键盘按钮

本页使用了标题或全文手工转换
被永久保护的模板
维基百科,自由的百科全书
(重定向自Template:Keypress
文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

本模板{{key press}}旨在文章內插入如同電腦鍵盤按鍵及組合的顯示樣式。

例如

{{键盘按钮|A}}A

因為大部分鍵盤上的英文字母並不是小寫的a到z,故請改成大寫的。

键盘按钮组合

要组合显示按键,可以这样输入:

{{键盘按钮|Alt|P}}Alt+P
{{键盘按钮|Ctrl|Alt|Del}}Ctrl+Alt+Del

當本模板的參數超過2個的時候,按鍵之間會使用兩側沒有空白的「+」、或是手動設定的chain參數夾著。 不過因為串接符號之間沒有空格,會導致整串按鍵組合不會自動換行。為了避免按鍵組合過長,導致像是在表格中過寬的問題,你可以重複呼叫本模板,並手動增加兩側有空白的「+」:

{{键盘按钮|Ctrl}} + {{键盘按钮|Alt}} + {{键盘按钮|Del}}Ctrl + Alt + Del

或是調整chain參數成:

{{键盘按钮|Ctrl|Alt|Del|chain= + }}Ctrl + Alt + Del

On the other hand, to illustrate Windows Alt codes 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 0177 (with the numeric keypad). This could be illustrated like this:

{{键盘按钮|Alt|0}}{{键盘按钮|1}}{{键盘按钮|7}}{{键盘按钮|7}} produces Alt+0177

維基鏈接

你可以在有關鍵盤的條目內使用此模板,例如:

  • {{键盘按钮|[[Alt]]}} 產生 Alt

當你在使用此模板時,請確保你鏈接到了正確的頁面(例如:使用[[Control key|Ctrl]]而不是[[Ctrl]],這會鏈接到一個消歧義頁面。)

Wiki markup characters

Some wiki markup character, like the pipe symbol, the semicolon and the equals sign, need to be entered using the {{!}}, {{;}} and {{=}} templates:

  • {{键盘按钮|{{!}}}} produces |
  • {{键盘按钮|{{;}}}} produces ;
  • {{键盘按钮|{{=}}}} produces =

However, if the characters are marked as wikilinks, they can be entered as such:

  • {{键盘按钮|[[|]]}} produces |
  • {{键盘按钮|[[;]]}} produces ;
  • {{键盘按钮|[[=]]}} produces =

If you don't want to mark the characters as links, {{键盘按钮|<nowiki>|</nowiki>}} is also an option.

鍵盤符號

某些按鍵名有其對應的Unicode字符。本模板會自動向下列按鍵名後加入對應「符號」:

  • {{键盘按钮|Shift}} 產生 ⇧ Shift
  • {{键盘按钮|Caps Lock}} 產生 ⇪ Caps Lock
  • {{键盘按钮|Enter}} 產生 ↵ Enter
  • {{键盘按钮|Tab}} 產生 Tab ↹
  • {{键盘按钮|Backspace}} 產生 ← Backspace
  • {{键盘按钮|Command}} 產生 ⌘ Command
  • {{键盘按钮|Cmd}} 產生 ⌘ Cmd
  • {{键盘按钮|Option}} 產生 ⌥ Option
  • {{键盘按钮|Opt}} 產生 ⌥ Opt
  • {{键盘按钮|Up}} 產生
  • {{键盘按钮|Down}} 產生
  • {{键盘按钮|Left}} 產生
  • {{键盘按钮|Right}} 產生
“Windows”徽標鍵與菜單鍵
老式“Windows”徽標鍵

There are no characters for the Windows key and Menu key. Besides, the Windows logo is trademarked. So this template shows approximate characters for them in the following way:

  • {{键盘按钮|Win}} produces ⊞ Win
  • {{键盘按钮|Menu}} produces ≣ Menu

電子遊戲

Video game controllers often have specialized input labels that do not map easily. The following are mappings for various game consoles and input features.

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.

  • {{键盘按钮|l-down}} produces L↓
  • {{键盘按钮|c-left}} produces C←
  • {{键盘按钮|r-up}} produces R↑

Stick specific diagonals are also supported:

  • {{键盘按钮|l-nw}} produces L↖
  • {{键盘按钮|c-se}} produces C↘
  • {{键盘按钮|r-ne}} produces R↗
PlayStation
  • {{键盘按钮|ex}} produces ×
  • {{键盘按钮|circle}} produces
  • {{键盘按钮|triangle}} produces
  • {{键盘按钮|square}} produces

模板參數

Illustrates keys and keystrokes on a computer keyboard. Keys can include: Ctrl, Alt, Del, Opt, Menu, Left etc. console keys: ex, circle, triangle, square, and left right and center analog sticks: l-down, c-left, r-ne. The names are case insensitive.

模板参数[编辑模板数据]

参数描述类型状态
第一個按鍵1

第一個按鍵

单行文本必需
第二個按鍵2

按鍵組合中的第二個按鍵(可選)

单行文本可选
第三個按鍵3

按鍵組合中的第三個按鍵(可選)

单行文本可选
第四個按鍵4

按鍵組合中的第四個按鍵(可選)

单行文本可选
第五個按鍵5

按鍵組合中的第五個按鍵(可選)

单行文本可选
第六個按鍵6

按鍵組合中的第六個按鍵(可選)

单行文本可选
第七個按鍵7

按鍵組合中的第七個按鍵(可選)

单行文本可选
第八個按鍵8

按鍵組合中的第八個按鍵(可選)

单行文本可选
第九個按鍵9

按鍵組合中的第九個按鍵(可選)

单行文本可选
第十個按鍵10

按鍵組合中的第十個按鍵(可選)

单行文本可选
串接符號chain

按鍵組合中串接各個按鍵使用的符號

默认值
+
单行文本可选
串接符號#1chain first

按鍵組合中串接第一和第二按鍵使用的符號

默认值
+
单行文本可选
串接符號#2chain second

按鍵組合中串接第二和第三按鍵使用的符號

默认值
+
单行文本可选
串接符號#3chain third

按鍵組合中串接第三和第四按鍵使用的符號

默认值
+
单行文本可选
串接符號#4chain fourth

按鍵組合中串接第四和第五按鍵使用的符號

默认值
+
单行文本可选

參見

  • {{Key top}} – 產生類似視覺效果,但包含更多的符號,但不能直接支持組合 (e.g. ⇬ Caps Lock)
  • {{Button}} – 產生類似視覺效果,但沒有語義標記 (e.g. sample text); 更多用於表示界面元素。
  • {{Kbd}} – to indicate user input (of any kind) without making it look like keys or buttons

Template:Semantic markup templates