Difference between revisions of "Template:Key press"
Jump to navigation
Jump to search
Debug data:
m |
(Added to documentation: Some code that can be copied into articles. WIP, needs more keys added.) |
||
Line 1: | Line 1: | ||
− | <includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em;white-space:nowrap;font-family:sans-serif>{{{key|{{{1|=}}}}}}</kbd></includeonly><noinclude>A simple template that makes it easier to see that a keyboard key is involved. | + | <includeonly><kbd style="display:inline-block;border:medium {{{border|{{{2|outset}}}}}} gray;padding:0 .3em;line-height:1em;white-space:nowrap;font-family:sans-serif>{{{key|{{{1|=}}}}}}</kbd></includeonly><noinclude><!-- Do not put any white space, including new line, between the end tag of includeonly and start tag of noinclude, else pages will break. |
+ | -->A simple template that makes it easier to see that a keyboard key is involved. | ||
==Usage== | ==Usage== | ||
Line 8: | Line 9: | ||
* The <var>key</var> and <var>border</var> parameters can be reversed, but then their names need to be specified: <code><nowiki>{{</nowiki>Key press<nowiki>|border=inset|key=F4}}</nowiki></code> will become {{Key press|border=inset|key=F4}} | * The <var>key</var> and <var>border</var> parameters can be reversed, but then their names need to be specified: <code><nowiki>{{</nowiki>Key press<nowiki>|border=inset|key=F4}}</nowiki></code> will become {{Key press|border=inset|key=F4}} | ||
* Forgetting to specify a key will default to the equals sign: <code><nowiki>{{</nowiki>Key press<nowiki>}}</nowiki></code> becomes {{Key press }}. | * Forgetting to specify a key will default to the equals sign: <code><nowiki>{{</nowiki>Key press<nowiki>}}</nowiki></code> becomes {{Key press }}. | ||
+ | |||
+ | ==Common keys== | ||
+ | For ease of use and consistency throughout pages, the code for some common multi-letter keys is provided here, ready to be copied and pasted into articles. Symbols rely on UTF-8 support by the browser and a font that contains the glyph, so for best compatibility, the text-only version of the code can be recommended for use in most articles. Not every key has a corresponding symbol. | ||
+ | {| class="wikitable sortable" style="margin-left:auto; margin-right:auto" | ||
+ | |+Often-used keys | ||
+ | ! scope="col"|Key | ||
+ | ! scope="col"|Text | ||
+ | ! scope="col"|Symbol | ||
+ | ! scope="col"|Symbol with text | ||
+ | ! scope="col"|Text with symbol | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Shift | ||
+ | | | ||
+ | ;{{Key press|Shift}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⇧}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⇧}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&uArr;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⇧ Shift}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⇧ Shift}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8679; Shift}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&uArr; Shift}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Shift ⇧}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift ⇧}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &#8679;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Shift &uArr;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Control | ||
+ | | | ||
+ | ;{{Key press|Ctrl}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|^}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|^}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|^ Ctrl}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|^ Ctrl}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Ctrl ^}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Ctrl ^}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Command | ||
+ | | | ||
+ | ;{{Key press|Command}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌘}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌘}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌘ Command}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌘ Command}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8984; Command}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Command ⌘}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command ⌘}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Command &#8984;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Option | ||
+ | | | ||
+ | ;{{Key press|Option}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌥}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌥}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⌥ Option}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌥ Option}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8997; Option}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Option ⌥}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option ⌥}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Option &#8997;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Alt | ||
+ | | | ||
+ | ;{{Key press|Alt}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Alt}}</nowiki></code> | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Alt Graph | ||
+ | | | ||
+ | ;{{Key press|AltGr}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|AltGr}}</nowiki></code> | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Space | ||
+ | | | ||
+ | ;{{Key press|Space}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⎵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⎵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|⎵ Space}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⎵ Space}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#9141; Space}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Space ⎵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space ⎵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Space &#9141;}}</nowiki></code> | ||
+ | |||
+ | |- style="vertical-align:top" | ||
+ | ! scope="row" style="text-align:left"|Enter | ||
+ | | | ||
+ | ;{{Key press|Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|↵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|↵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&crarr;}}</nowiki></code> | ||
+ | ;{{Key press|⌤}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌤}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996;}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|↵ Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|↵ Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8629; Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&crarr; Enter}}</nowiki></code> | ||
+ | ;{{Key press|⌤ Enter}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|⌤ Enter}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|&#8996; Enter}}</nowiki></code> | ||
+ | | | ||
+ | ;{{Key press|Enter ↵}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter ↵}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8629;}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &crarr;}}</nowiki></code> | ||
+ | ;{{Key press|Enter ⌤}} | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter ⌤}}</nowiki></code> | ||
+ | :<code><nowiki>{{</nowiki>Key press<nowiki>|Enter &#8996;}}</nowiki></code> | ||
+ | |||
+ | |} | ||
+ | <!--TO DO: Add Super, Menu, BS, Esc, PrtScr, ScLock, CapsLock, Pause, NumLock, Ins, Del, Home, PgUp, PgDn, ?Home?, ?End?, arrows.--> | ||
</noinclude> | </noinclude> |
Revision as of 14:05, 15 June 2020
A simple template that makes it easier to see that a keyboard key is involved.
Usage
{{Key press|key|border style}}
- key is the literal name of the key to be pressed. For F4, for example, the syntax is
{{Key press|F4}}
. This results in the following: F4 - HTML character entities are allowed. For example, to display the multiplication symbol, this works:
{{Key press|×}}
and results in ×. - To display a pressed key, add
inset
border style like this:{{Key press|F4|inset}}
and the key will appear to be pressed: F4. - The key and border parameters can be reversed, but then their names need to be specified:
{{Key press|border=inset|key=F4}}
will become F4 - Forgetting to specify a key will default to the equals sign:
{{Key press}}
becomes =.
Common keys
For ease of use and consistency throughout pages, the code for some common multi-letter keys is provided here, ready to be copied and pasted into articles. Symbols rely on UTF-8 support by the browser and a font that contains the glyph, so for best compatibility, the text-only version of the code can be recommended for use in most articles. Not every key has a corresponding symbol.
Key | Text | Symbol | Symbol with text | Text with symbol |
---|---|---|---|---|
Shift |
|
|
|
|
Control |
|
|
|
|
Command |
|
|
|
|
Option |
|
|
|
|
Alt |
|
|||
Alt Graph |
|
|||
Space |
|
|
|
|
Enter |
|
|
|
|
Debug data:
[SQLBagOStuff] MainObjectStash using store ReplicatedBagOStuff
[objectcache] MainWANObjectCache using store EmptyBagOStuff
IP: 3.17.74.181
Start request GET /mediawiki/index.php?diff=prev&oldid=6692&title=Template%3AKey_press
HTTP HEADERS:
CONTENT-TYPE:
CONTENT-LENGTH: 0
USER-AGENT: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HOST: zero-k.info
COOKIE: wikidb229_mw__session=voauu4psb49h6vpbc255kahhfj5rd47u
ACCEPT-ENCODING: gzip, br, zstd, deflate
ACCEPT: */*
CONNECTION: close[localisation] LocalisationCache: using store LCStoreDB
[session] SessionManager using store SqlBagOStuff
[session] Session "voauu4psb49h6vpbc255kahhfj5rd47u" requested without UserID cookie
[DBReplication] Cannot use ChronologyProtector with EmptyBagOStuff
[DBReplication] Wikimedia\Rdbms\LBFactory::getChronologyProtector: request info {
"IPAddress": "3.17.74.181",
"UserAgent": "Mozilla\/5.0 AppleWebKit\/537.36 (KHTML, like Gecko; compatible; ClaudeBot\/1.0; +claudebot@anthropic.com)",
"ChronologyProtection": false,
"ChronologyPositionIndex": 0,
"ChronologyClientId": false
}[DBConnection] Wikimedia\Rdbms\LoadBalancer::lazyLoadReplicationPositions: executed chronology callback.
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'localhost'.
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'localhost'.
Title::getRestrictionTypes: applicable restrictions to [[Template:Key press]] are {edit,move}
[ContentHandler] Created handler for wikitext: WikitextContentHandler
Article::view: showing diff page
DifferenceEngine old '6692' new 'prev' rcid ''
[MessageCache] MessageCache using store SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for wikidb229-mw_:messages:en.
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database
ParserFactory: using preprocessor: Preprocessor_Hash
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions->__construct
DifferenceEngine old '0' new '0' rcid '0'
WikiPage::getParserOutput: using parser cache: no
[caches] parser: SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #126 (handle id #120) will be used for SqlBagOStuff
Parser cache options found.
[Preprocessor] Cached preprocessor output (key: wikidb229-mw_:preprocess-hash:37b95acb312cf9c56523b4846ba02fba:0)
[Parser] Parser::setOutputFlag: set vary-revision-sha1 flag on 'Template:Key press'; Self transclusion
[Preprocessor] Cached preprocessor output (key: wikidb229-mw_:preprocess-hash:37b95acb312cf9c56523b4846ba02fba:1)
[Preprocessor] Cached preprocessor output (key: wikidb229-mw_:preprocess-hash:37b95acb312cf9c56523b4846ba02fba:0)
MediaWiki::preOutputCommit: primary transaction round committed
MediaWiki::preOutputCommit: pre-send deferred updates completed
MediaWiki::preOutputCommit: session changes committed
MediaWiki::preOutputCommit: LBFactory shutdown completed
Title::getRestrictionTypes: applicable restrictions to [[Template:Key press]] are {edit,move}