Difference between revisions of "Template:Shortcut"

From Audacity Wiki
Jump to: navigation, search
(matches Manual; depends on shortcut css class)
(Restore 36577 now that we have string functions.)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{Intro|The '''''Shortcut'' Template''' formats a string of text defining a '''Keyboard Shortcut''' with a standard background colour to make it stand out amongst the surrounding text. Keyboard shortcuts are key presses which access menu items and/or perform actions in programs.|}}
+
<noinclude>
 +
An example here: {{shortcut|CTRL + A}}.  The idea is to represent shortcuts.  This has a box round it just as kbrd does, but the colour is purple rather than white. If we want different colours we can, e.g. {{shortcut|CTRL + A|d5c9e6}} gives the old darker purple we used to have before we added the box.  The feature now also supports showing the Mac symbol for command.
  
 +
==More Examples==
  
'''Purpose'''
+
'''Standard example'''
 +
{{code| <nowiki>{{shortcut|Ctrl + Alt + Z}}</nowiki>}}
 +
{{shortcut|Ctrl + Alt + Z}}
  
This formatting can be used for shortcuts in any program (not just Audacity) or for those in operating systems. Examples of such shortcuts are:
 
  
*CTRL + A
+
'''Example using Cmd'''
*ALT + Z
+
{{code| <nowiki>{{shortcut|Cmd + Z}}</nowiki>}}
*CTRL + SHIFT + X
+
{{shortcut|Cmd + Z}}
*CMD + F (Mac computers)
 
  
For more details of Audacity keyboard shortcuts, please see [[KeyboardLayouts|Keyboard Layouts]].   
 
 
 
  
'''''NOTE:''''' This template should be used '''only for ''keyboard shortcuts'''''. ''Other templates are available for other uses, see [[:Category:Templates|Templates]].''
+
'''If the text is empty, then the format box is omitted too.'''
 +
{{code| <nowiki>ABC{{shortcut|}}DEF</nowiki>}}
 +
ABC{{shortcut|}}DEF
  
  
'''Usage of Shortcut Template''':<br>
+
'''Example with a different colour.'''
 +
{{code| <nowiki>{{shortcut|Ctrl + Alt + Z|a0c0a0}}</nowiki>}}
 +
{{shortcut|Ctrl + Alt + Z|d0f0d0}}
  
<nowiki>{{</nowiki>shortcut|''text to be formatted''<nowiki>}}</nowiki>
 
  
For example, typing this:
+
</noinclude><includeonly>{{#if:{{{1|}}}|<span class="kbrd" style="background-color: #{{{2|d0d0f8}}}">{{#replace:{{{1}}}|Cmd|&#8984;}}</span>|}}</includeonly>
<nowiki>{{</nowiki>shortcut|CTRL + V<nowiki>}}</nowiki>
 
 
 
will cause the following to be displayed:
 
 
 
<span class="shortcut">CTRL +V</span>
 
 
 
[[Category:Templates]]
 
----
 
''Ignore the following, it's only a representation of formatting and a parameter dummy.''
 
 
 
</noinclude><span class="shortcut">{{{1}}}</span>
 

Latest revision as of 15:55, 12 September 2018

An example here: CTRL + A. The idea is to represent shortcuts. This has a box round it just as kbrd does, but the colour is purple rather than white. If we want different colours we can, e.g. CTRL + A gives the old darker purple we used to have before we added the box. The feature now also supports showing the Mac symbol for command.

More Examples

Standard example

{{shortcut|Ctrl + Alt + Z}}

Ctrl + Alt + Z


Example using Cmd

{{shortcut|Cmd + Z}}

⌘ + Z


If the text is empty, then the format box is omitted too.

ABC{{shortcut|}}DEF

ABCDEF


Example with a different colour.

{{shortcut|Ctrl + Alt + Z|a0c0a0}}

Ctrl + Alt + Z