<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for GNU Texinfo (version 6.7, 23 September 2019),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.
Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995, 1996, 1997,
1998, 1999, 2001, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Free Software
Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>@kbd (GNU Texinfo 6.7)</title>
<meta name="description" content="@kbd (GNU Texinfo 6.7)">
<meta name="keywords" content="@kbd (GNU Texinfo 6.7)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Indicating.html" rel="up" title="Indicating">
<link href="_0040key.html" rel="next" title="@key">
<link href="_0040code.html" rel="prev" title="@code">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<span id="g_t_0040kbd"></span><div class="header">
<p>
Next: <a href="_0040key.html" accesskey="n" rel="next"><code>@key</code></a>, Previous: <a href="_0040code.html" accesskey="p" rel="prev"><code>@code</code></a>, Up: <a href="Indicating.html" accesskey="u" rel="up">Indicating</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="g_t_0040kbd_007bkeyboard_002dcharacters_007d"></span><h4 class="subsection">7.1.3 <code>@kbd</code>{<var>keyboard-characters</var>}</h4>
<span id="kbd"></span><span id="index-kbd"></span>
<span id="index-Keyboard-input"></span>
<p>Use the <code>@kbd</code> command for characters of input to be typed by
users. For example, to refer to the characters <kbd>M-a</kbd>, write:
</p>
<div class="example">
<pre class="example">@kbd{M-a}
</pre></div>
<p>and to refer to the characters <kbd>M-x shell</kbd>, write:
</p>
<div class="example">
<pre class="example">@kbd{M-x shell}
</pre></div>
<span id="index-User-input"></span>
<span id="index-Slanted-typewriter-font_002c-for-_0040kbd"></span>
<p>By default, the <code>@kbd</code> command produces a different font
(slanted typewriter instead of normal typewriter),
so users can distinguish the characters that they are supposed
to type from those that the computer outputs.
</p>
<span id="index-kbdinputstyle"></span>
<p>Since the usage of <code>@kbd</code> varies from manual to manual, you can
control the font switching with the <code>@kbdinputstyle</code> command.
This command has no effect on Info output. Write this command at the
beginning of a line with a single word as an argument, one of the
following:
</p>
<span id="index-distinct_002c-value-for-_0040kbdinputstyle"></span>
<span id="index-example_002c-value-for-_0040kbdinputstyle"></span>
<span id="index-code_002c-value-for-_0040kbdinputstyle"></span>
<dl compact="compact">
<dt>‘<samp>code</samp>’</dt>
<dd><p>Always use the same font for <code>@kbd</code> as <code>@code</code>.
</p></dd>
<dt>‘<samp>example</samp>’</dt>
<dd><p>Use the distinguishing font for <code>@kbd</code> only in <code>@example</code>
and similar environments.
</p></dd>
<dt>‘<samp>distinct</samp>’</dt>
<dd><p>(the default) Always use the distinguishing font for <code>@kbd</code>.
</p></dd>
</dl>
<p>You can embed another @-command inside the braces of a <code>@kbd</code>
command. Here, for example, is the way to describe a command that
would be described more verbosely as “press the ‘<samp>r</samp>’ key and then
press the <tt class="key">RETURN</tt> key”:
</p>
<div class="example">
<pre class="example">@kbd{r @key{RET}}
</pre></div>
<p>This produces: <kbd>r <span class="key">RET</span></kbd>. (The present manual uses the
default for <code>@kbdinputstyle</code>.)
</p>
<p>You also use the <code>@kbd</code> command if you are spelling out the letters
you type; for example:
</p>
<div class="example">
<pre class="example">To give the @code{logout} command,
type the characters @kbd{l o g o u t @key{RET}}.
</pre></div>
<p>This produces:
</p>
<blockquote>
<p>To give the <code>logout</code> command,
type the characters <kbd>l o g o u t <span class="key">RET</span></kbd>.
</p></blockquote>
<p>(Also, this example shows that you can add spaces for clarity. If you
explicitly want to mention a space character as one of the characters of
input, write <kbd>@key{SPC}</kbd> for it.)
</p>
<hr>
<div class="header">
<p>
Next: <a href="_0040key.html" accesskey="n" rel="next"><code>@key</code></a>, Previous: <a href="_0040code.html" accesskey="p" rel="prev"><code>@code</code></a>, Up: <a href="Indicating.html" accesskey="u" rel="up">Indicating</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>