模板:键盘按钮
页面Module:Documentation/styles.css没有内容。
package.lua第80行Lua错误:module 'Module:CGroup/core' not found
- REDIRECT Template:改进使用说明
Template:Lua 脚本错误:没有“Shortcut”这个模块。 本模板{{key press}}旨在文章内插入如同电脑键盘按键及组合的显示样式。
例如
{{键盘按钮|A}}→ 脚本错误:没有“key”这个模块。
因为大部分键盘上的英文字母并不是小写的a到z,故请改成大写的。
键盘按钮组合[编辑]
要组合显示按键,可以这样输入:
{{键盘按钮|Alt|P}}→ 脚本错误:没有“key”这个模块。
{{键盘按钮|Ctrl|Alt|Del}}→ 脚本错误:没有“key”这个模块。
当本模板的参数超过2个的时候,按键之间会使用两侧没有空白的“+”、或是手动设定的chain参数夹着。 不过因为串接符号之间没有空格,会导致整串按键组合不会自动换行。为了避免按键组合过长,导致像是在表格中过宽的问题,你可以重复呼叫本模板,并手动增加两侧有空白的“+”:
{{键盘按钮|Ctrl}} + {{键盘按钮|Alt}} + {{键盘按钮|Del}}→ 脚本错误:没有“key”这个模块。 + 脚本错误:没有“key”这个模块。 + 脚本错误:没有“key”这个模块。
或是调整chain参数成:
- 脚本错误:没有“Tlg”这个模块。 → 脚本错误:没有“key”这个模块。
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 脚本错误:没有“key”这个模块。脚本错误:没有“key”这个模块。脚本错误:没有“key”这个模块。脚本错误:没有“key”这个模块。
维基链接[编辑]
你可以在有关键盘的条目内使用此模板,例如:
{{键盘按钮|[[Alt]]}}产生 脚本错误:没有“key”这个模块。
当你在使用此模板时,请确保你链接到了正确的页面(例如:使用[[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 脚本错误:没有“key”这个模块。{{键盘按钮|{{;}}}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|{{=}}}}produces 脚本错误:没有“key”这个模块。
However, if the characters are marked as wikilinks, they can be entered as such:
{{键盘按钮|[[|]]}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|[[;]]}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|[[=]]}}produces 脚本错误:没有“key”这个模块。
If you don't want to mark the characters as links, {{键盘按钮|<nowiki>|</nowiki>}} is also an option.
键盘符号[编辑]
某些按键名有其对应的Unicode字符。本模板会自动向下列按键名后加入对应“符号”:
{{键盘按钮|Shift}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Caps Lock}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Enter}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Tab}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Backspace}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Command}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Cmd}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Option}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Opt}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Up}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Down}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Left}}产生 脚本错误:没有“key”这个模块。{{键盘按钮|Right}}产生 脚本错误:没有“key”这个模块。
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 脚本错误:没有“key”这个模块。{{键盘按钮|Menu}}produces 脚本错误:没有“key”这个模块。
电子游戏[编辑]
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 脚本错误:没有“key”这个模块。{{键盘按钮|c-left}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|r-up}}produces 脚本错误:没有“key”这个模块。
Stick specific diagonals are also supported:
{{键盘按钮|l-nw}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|c-se}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|r-ne}}produces 脚本错误:没有“key”这个模块。
PlayStation[编辑]
{{键盘按钮|ex}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|circle}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|triangle}}produces 脚本错误:没有“key”这个模块。{{键盘按钮|square}}produces 脚本错误:没有“key”这个模块。
模板参数[编辑]
<templatedata> { "description": "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.", "params": { "1": { "label": "第一个按键", "description": "第一个按键", "type": "line", "required": true }, "2": { "label": "第二个按键", "description": "按键组合中的第二个按键(可选)", "type": "line", "required": false }, "3": { "label": "第三个按键", "inherits": "2", "description": "按键组合中的第三个按键(可选)" }, "4": { "label": "第四个按键", "inherits": "2", "description": "按键组合中的第四个按键(可选)" }, "5": { "label": "第五个按键", "inherits": "2", "description": "按键组合中的第五个按键(可选)" }, "6": { "label": "第六个按键", "inherits": "2", "description": "按键组合中的第六个按键(可选)" }, "7": { "label": "第七个按键", "inherits": "2", "description": "按键组合中的第七个按键(可选)" }, "8": { "label": "第八个按键", "inherits": "2", "description": "按键组合中的第八个按键(可选)" }, "9": { "label": "第九个按键", "inherits": "2", "description": "按键组合中的第九个按键(可选)" }, "10": { "label": "第十个按键", "inherits": "2", "description": "按键组合中的第十个按键(可选)" }, "chain": { "label": "串接符号", "description": "按键组合中串接各个按键使用的符号", "default": "+", "inherits": "2" }, "chain first": { "description": "按键组合中串接第一和第二按键使用的符号", "inherits": "chain", "label": "串接符号#1" }, "chain second": { "description": "按键组合中串接第二和第三按键使用的符号", "inherits": "chain", "label": "串接符号#2" }, "chain third": { "description": "按键组合中串接第三和第四按键使用的符号", "inherits": "chain", "label": "串接符号#3" }, "chain fourth": { "description": "按键组合中串接第四和第五按键使用的符号", "inherits": "chain", "label": "串接符号#4" } } } </templatedata>
参见[编辑]
- Template:Tlx – 产生类似视觉效果,但包含更多的符号,但不能直接支持组合 (e.g. Template:Key top)
- Template:Tlx – 产生类似视觉效果,但没有语义标记 (e.g. sample text); 更多用于表示界面元素。
- Template:Tlx – to indicate user input (of any kind) without making it look like keys or buttons