DocBook 5.1: The Definitive Guide  (Version 1.5.3 for DocBook 5.1)

keycap

keycap — The text printed on a key on a keyboard.

Synopsis

keycap ::= [-]

Attributes

Common attributes and common linking attributes.

Additional attributes:

  • Exactly one of:
    • function (enumeration)
      • “alt”
      • “altgr”
      • “backspace”
      • “command”
      • “control”
      • “delete”
      • “down”
      • “end”
      • “enter”
      • “escape”
      • “home”
      • “insert”
      • “left”
      • “meta”
      • “option”
      • “pagedown”
      • “pageup”
      • “right”
      • “return”
      • “shift”
      • “space”
      • “tab”
      • “up”
    • Each of:
      • function (enumeration)
        • “other”
      • otherfunction

Required attributes are shown in bold.

Description

The keycap identifies the text printed on a physical key on a computer keyboard. This is distinct from any scan code that it may generate (keycode), or any symbolic name (keysym) that might exist for the key.

Processing expectations

Formatted inline.

Attributes

Common attributes and common linking attributes.

function

Identifies the function key

Enumerated values:
“alt”

The "Alt" key

“altgr”

The "Alt Graph" key

“backspace”

The "Backspace" key

“command”

The "Command" key

“control”

The "Control" key

“delete”

The "Delete" key

“down”

The down arrow

“end”

The "End" key

“enter”

The "Enter" key

“escape”

The "Escape" key

“home”

The "Home" key

“insert”

The "Insert" key

“left”

The left arrow

“meta”

The "Meta" key

“option”

The "Option" key

“pagedown”

The page down key

“pageup”

The page up key

“right”

The right arrow

“return”

The "Return" key

“shift”

The "Shift" key

“space”

The spacebar

“tab”

The "Tab" key

“up”

The up arrow

otherfunction

Specifies a keyword that identifies the non-standard key

Children

The following elements occur in keycap: text, abbrev, acronym, alt, anchor, annotation, biblioref, coref, date, emphasis (db._emphasis), firstterm (db._firstterm), footnote, footnoteref, foreignphrase (db._foreignphrase), glossterm (db._glossterm), indexterm (db.indexterm.endofrange), indexterm (db.indexterm.singular), indexterm (db.indexterm.startofrange), inlinemediaobject, link, olink, phrase (db._phrase), quote (db._quote), remark, replaceable, subscript, superscript, trademark, wordasword, xref.

Examples

<article xmlns='http://docbook.org/ns/docbook'>
<title>Example keycap</title>

<para>The <keycap>F1</keycap> key on an IBM PC keyboard generates the
scan code <keycode>0x3B</keycode> when pressed.  This value
is defined as <keysym>KEY_F1</keysym> in 
<filename class="headerfile">keyboard.h</filename>.
</para>

</article>

The F1 key on an IBM PC keyboard generates the scan code 0x3B when pressed. This value is defined as KEY_F1 in keyboard.h.