Template talk:Key press

message: I personally think we should have an actual picture of a key.
–Sidious1701(talk • email • todo) 21:16, 13 January 2008 (UTC)
replies: text: See WP:MOS#Images as text. Chris Cunningham (not at work) - talk 11:38, 14 August 2008 (UTC)
replies: text: Doesn't work anyway. This does not look as-intended on Firefox 4, Win 7, for example; the value is next to, not on top of, the image. — SMcCandlish   Talk⇒ ʕ(Õلō)ˀ  Contribs. 15:40, 19 June 2011 (UTC)
thread_title:  Picture of a key 

message: This would probably be better accessibility-wise than having users manually include symbols. It's supported by mosy standards-compliant browsers. Chris Cunningham (not at work) - talk 10:42, 14 August 2008 (UTC)
replies: text: Bah. I've realised that this won't work, because pseudo-classes can't be styled using style attributes. I suppose something could be added to common.css, but that's a bit more work than I'd have liked. Chris Cunningham (not at work) - talk 11:36, 14 August 2008 (UTC)
thread_title:  Using <samp>:before</samp> CSS class to show images 

message: I have just reworked the code of this template. There's no change in looks and no real change in functionality. Here's what I have done and why:
1: I moved the code that was used repeatedly to the  sub-template. I also moved the unicode symbol inserting code from the old subtemplate  to /core. This means  is not used anymore. But I think we should keep the old /Switch template for reference and otherwise  looks seriously broken when looking at older versions of it. Since we already had the /Switch sub-template which was always called this means no change in efficiency. (Note that it takes some time before the "What links here" lists are updated, since pages are only re-rendered when visited.)
2: I added a "←" symbol when "Backspace" is fed, thus rendering "← Backspace".
3: I simplified/compacted the CSS style code somewhat. (See the code in .) It causes no change in appearance. And these keys look fine in the browsers I have (a very old IE 5.5, a slightly old Opera 9.02 and a Firefox 2.0).
4: This template used to be able to take 10 key parameters. But the worst case I could find only used 4 parameters, so 10 seems to be overkill. I lowered it to 5 to still have some margin. To make sure I made it so this template reports into :Category:Wikipedia keypress template parameter needs fixing if it gets too many parameters. This means we can easily find those pages and fix them, or we can discover if we need to make this template take more parameters. It usually takes about 2 weeks until nearly all cases get visible in such a category, since pages are only re-rendered when someone visits them. I made the category hidden for now, so we can have a look at the cases (if any) without most other editors noticing. So we can decide on how many parameters we need. After about 2 weeks when we have had our look we should make the category visible, so editors that use this template on pages will notice when they use too many parameters.
--David Göthberg (talk) 18:25, 23 March 2009 (UTC)
thread_title:  My rework of this template 

message: Unfortunately it seems that Opera allows a line break after the left border (!) of the first key image produced by a template, thus breaking the image. You can prevent this from happening by disallowing a break right before the template by using a no-break space between the template and the preceding character. In the case of several adjacent templates you can wrap them all together with .
Is there any better way to prevent these brain-dead line breaks?  —Preceding unsigned comment added by Simo Kaupinmäki (talk • contribs) 18:52, 7 September 2010 (UTC)
replies: text: Unfortunately, no. The core template is already wrapped in a no-wrap span. Wrapping it in another span is ugly, and may not solve the problem. But I will try to eliminate preciding spaces.  — Edokter • Talk •  01:42, 8 September 2010 (UTC)
replies: text: Thanks for the effort, but it doesn't seem to help. And you were correct in assuming that putting the no-wrap span into the main template does not make any difference either. I even tried to replace the regular spaces in the main template with no-break spaces, but to no avail. It looks like the odd line breaks can't be prevented from within the template, so if you want to play safe, you need to separately disallow breaking just before each template. Too bad. – Simo Kaupinmäki (talk) 12:43, 8 September 2010 (UTC)
thread_title:  Opera allows a line break after the left border of a key image 

message: Can I make a request to include mouse buttons e.g.:
* left mouse button (or just LMB)
* middle (MMB)
* right (RMB)
* wheel up (MWU)
* wheel down (MWD)
Something like that? --Robinson weijman (talk) 09:30, 5 October 2010 (UTC)
replies: text: You can already put in anything you want; you just have to enter exactly what you want to show, like , but this template wasn't intended with mouse buttons in mind.  — Edokter • Talk •  14:04, 5 October 2010 (UTC)
replies: text:  Ah, yes, of course. Thanks! --Robinson weijman (talk) 06:16, 6 October 2010 (UTC)
replies: text:  You could also use    . ›mysid (☎∆✎) 13:15, 6 October 2010 (UTC)
replies: text:  Nice one - can anyone (with expertise) add them to the template? I might be tempted to give it a go... =:-)  —Preceding unsigned comment added by Robinson weijman (talk • contribs) 18:36, 9 October 2010 (UTC)
replies: text: You can expiriment in the sandbox, but I do believe mouse buttons are outside the scope of this template.  perhaps?  — Edokter • Talk •  19:00, 9 October 2010 (UTC)
replies: text: Another thing to consider is that the functions of the left and right mouse button are often reversed for left-handed people, in which case such images can be rather confusing. (Therefore it is also better to speak of primary and secondary mouse buttons unless you know for sure that the user's mouse has been configured to function as right-handed.) – Simo Kaupinmäki (talk) 23:01, 10 October 2010 (UTC)
replies: text: Furthermore, this would generally violate the guidelines at WP:ICONS - don't use iconic images as cutesy replacements for simple wording unless there's a very good reason to do so (e.g. because in a wide and long table of sporting statistics,  is more concise than Republic of Ireland, and flags actually usually help people find the competitors they are interested in, thus their use in Olympics Games broadcasts, etc.). And yes, it would need to be a different mouse click template even if it wasn't an obvious WP:ICONS problem, since they would serve different purposes. — SMcCandlish   Talk⇒ ʕ(Õلō)ˀ  Contribs. 09:25, 19 June 2011 (UTC)
thread_title:  Mouse buttons 

message: What I've seen on some keyboards and in the keyboard template is that the Caps Lock key has a solid version of the upward pointing arrow that is used for the shift key. Is there a unicode solid arrow that can/should be used?Naraht (talk) 14:10, 14 February 2011 (UTC)
replies: text: Arrow (symbol). — Dispenser 15:16, 14 February 2011 (UTC)
replies: text: Upwards Thick Arrow From Bar 0x21ea may be appropriate.Naraht (talk) 16:41, 14 February 2011 (UTC)
replies: text: I've added it.  — Edokter (talk) —  16:59, 14 February 2011 (UTC)

text: ISO/IEC 9995:  vs.  vs.  (and  vs.  vs.  or  vs. ) — Christoph Päper 09:21, 16 July 2015 (UTC)
thread_title:  Caps Lock symbol 

message: Shouldn't this be  instead of ?  It took several years to get the MediaWiki developers to properly and fully support the semantic markup elements like , , etc.  Shame not to actually use them for their intended use. Especially since  has no semantic meaning at all, much less an appropriate one. — SMcCandlish   Talk⇒ ʕ(Õلō)ˀ  Contribs. 09:20, 19 June 2011 (UTC)
replies: text: turns the text into a monospace font, which is not what we want. So while maybe semantically correct, visually it looks horrible.  — Edokter (talk) —  13:14, 19 June 2011 (UTC)
replies: text: Forgot about that.  It's an easy CSS fix: Template:Key press/Sandbox.  Barring any objections, I'd like to install this. — SMcCandlish   Talk⇒ ʕ(Õلō)ˀ  Contribs. 15:43, 19 June 2011 (UTC)
replies: text: .  — Edokter (talk) —  16:29, 19 June 2011 (UTC)
replies: text: I added the semantic markup category, and also made  a new, more general-use template in the XHTML tag replacements category (as a redirect to this template, the name was only used in one place). — SMcCandlish   Talk⇒ ʕ(Õلō)ˀ  Contribs. 21:11, 19 June 2011 (UTC)
thread_title:  The element <code>kbd</code> 

message: Thorn (letter) is showing up at . The thing is, I think its use of more than 5 keystrokes is legitimate: it's a composition using , which has to be held down for the duration of the sequence. Anyone know what the upper bound on these sequences is? If it's six characters, for instance, we can just slightly expand this codebase, whereas if it's open-ended we might want to rethink having a cleanup category for these. Chris Cunningham (user:thumperward) (talk) 15:52, 11 May 2012 (UTC)
replies: text: This template has a limit of five parameters indicating consecutively pressed keys (indicated with a '+' between the keys). Any keys types in sequense must be entered using a new instance of the template.  — Edokter (talk) —  19:47, 11 May 2012 (UTC)
replies: text:  Right, but the problem is how to represent a sequence which is "hold the Alt Gr key while typing these five characters in sequence, then release the Alt Gr key". Is it possibly worth concocting some sub-template at  to handle this use case? Chris Cunningham (user:thumperward) (talk) 09:13, 12 May 2012 (UTC)
replies: text:  How about +() ?  — Edokter (talk) —  20:52, 12 May 2012 (UTC)
replies: text: I concur with Edokter; that's a simple solution that doesn't require any new templates or more complicated template code. — SMcCandlish    Talk⇒ ɖ∘¿¤þ   Contrib.  07:41, 13 May 2012 (UTC)
replies: text:  Sounds good. That would empty the cleanup category. To be quite honest, I'd rather simply have it error out than silently do the wrong thing and categorise pages for cleanup: any objections to making that change? Chris Cunningham (user:thumperward) (talk) 09:38, 13 May 2012 (UTC)
replies: text: If you read through the template documentation, you can see that the solution mentioned by Edokter has also been suggested there – though without the parentheses. I don't think parentheses are really necessary here, as lack of punctuation between digits makes them appear as a group. – Simo Kaupinmäki (talk) 17:45, 27 June 2012 (UTC)

text: Sorry for necromancing this discussion, but +( does the same but is shorter. I don't know when the chain parameter was added so it might not be available 1.5 years ago. — xZise [disc] 19:08, 9 December 2013 (UTC)
thread_title:  [[Thorn (letter)]] and other {{key press|Alt Gr}} uses 

message: There was some discussion at Wikipedia:Templates for discussion/Log/2013 May 29#Template:DS/Wii key press with the outcome that this could be potentially merged here.  The code is now in User:QM400032/DS/Wii key press and User:QM400032/Electronic arrow button key press.  If this is needed or wanted, you may want to consider merging them.  However, the author is currently indef blocked. Thanks! Plastikspork ―Œ(talk) 14:07, 7 June 2013 (UTC)
thread_title:  DS/Wii and Electronic arrow button key 

message: I used this template (and the core template) for the Kerbal Space Programm Wiki. There I required a right shift so I added there right and left shift/2nd level, with the same features as the usual shift. Should this change added back into here? — xZise [disc] 11:56, 8 December 2013 (UTC)
thread_title:  Should there a distinction between left/right shift keys added? 

message: This template's doc does not describe which separator to use in case some keys are pressed in sequence, for instance in   to minimize (iconify) a window. I used a space here but this is not handled consistently in WP: someone else could have used , , - or —.  -- Juergen 37.252.110.97 (talk) 21:46, 8 June 2014 (UTC)
thread_title:  Separator for Key Sequences 

message: ANSI and VT codes consist of strings of characters, generally proceeded by the escape. To display these, someone suggesting using this template. It looks good, but it is hard to enter, because the template normally inserts plusses if multiple characters are entered in a single string. I don't want "press escape at the same time as I and 0", I need "press escape THEN I and THEN 0. Perhaps a flag to suppress the plus signs? Or maybe a different version that does it by default? Maury Markowitz (talk) 15:30, 5 February 2015 (UTC)
replies: text: You can simply use the template multiple times:   . 18:28, 5 February 2015 (UTC)
replies: text: Sure, but it's hard. Lots and lots of typing that's hard. Maury Markowitz (talk) 19:15, 5 February 2015 (UTC)

text: It turns out you can remove the "+" with  (leave it empty). -- User:Edokter  19:38, 5 February 2015 (UTC)
thread_title:  Key press change, or maybe new template "escape series"? 

message: In the current version of Template:Key_press/doc  the first para in the Key symbols section refers to some 'Arrows exception below' — but there's no 'arrows exception' below... --CiaPan (talk) 08:49, 9 July 2015 (UTC)
replies: text: Removed. Documentation pages are usually not protected, so you can fix them yourself. -- User:Edokter  20:38, 9 July 2015 (UTC)
replies: text:  Thank you. I know I could fix it myself—if I only knew how. So far I didn't know if that was a wrong reference (in 'arrows exception' semi-title OR in the direction indicator 'below') or possibly the 'arrows exception' has been deleted some time ago (and whether it should be restored or the reference removed accordingly) or may be the 'arrows exeption' part was intended to be added but somehow somebody missed it, so it is still absent. That's why I posted my observation here, in hope someone more fluent in English AND in the template history and use will do the work better than me. --CiaPan (talk) 07:32, 13 July 2015 (UTC)
replies: text: Ah OK. It was probably a reference to a deleted section. At one time, the template supported a multitude of arrows, but which were ususally not found on keyboards, so they were removed. -- User:Edokter  17:11, 13 July 2015 (UTC)
thread_title:  missing section in the description 

message: I've played around with the border/shadow definitions, and came up with this:
border:        none;
border-radius: 0.1em;
box-shadow:    0.1em -0.1em 0 0.1em #ddd, 
              -0.1em  0.1em 0 0.1em #aaa, 
               0      0     0 0.2em #bbb;
which should be rendered as ⇧ Shift instead of the current ⇧ Shift.
That's more aesthetic style in my opinion, and looks more like a keyboard key. ShoobyD (talk) 16:13, 17 February 2016 (UTC)
replies: text: That’s almost indistinguishable from ⇧ Shift with simpler 
border:        0.2em #ddd solid; 
border-color:  #ddd #ddd #aaa #aaa; 
border-radius: 0.2em;
 and less padding. — Christoph Päper 19:50, 17 February 2016 (UTC)
thread_title:  A more 'key-like' style 

message: 19:44, 1 July 2016 (UTC)
thread_title:  Alternate key press ayntax. 

message: I created Module:Key to fix the post-expand include size template errors at Table of keyboard shortcuts. The module can be called directly, and I have also changed this template to use the module.
Examples using the module directly:
* → 
* → 
Example using the template:
* → 
This shows there is no limit to the number of chained characters. However, there must be no missing parameters ( would fail). Johnuniq (talk) 04:26, 13 March 2017 (UTC)
thread_title:  Module:Key 

message: d:Wikidata:Property proposal/Key press  — Dispenser 21:39, 20 November 2017 (UTC)
thread_title:  Wikidata 

message: Is it legitimate to use, e.g.,  to indicate the sequence CR,LF? Is it legitimate to use the template for characters, or only for key strokes? --Shmuel (Seymour J.) Metz Username:Chatul (talk) 13:16, 28 July 2021 (UTC)
replies: text: Nothing is really illegitimate so long as it doesn't mislead visitors. The shading is intended to give the impression of a key-top, so it would be a bit odd. I suppose you really should use  to produce +. But the plus notation means "press these simultaneously", which I don't think is what you want? Should it be  (using ) or  (using )? The latter looks rather odd by modern standards and arguably misleading unless you put a thin space between the R and the L, so a very convincing reason to use  so there's your legitimacy defence. wp:BEBOLD, use it then see who complains and why. --John Maynard Friedman (talk) 15:57, 28 July 2021 (UTC)
thread_title:  Is it legitimate to use the template for a sequence of characters?