XML technologies / DocBook / Inline elements / Keyboard-specific elements
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
Many programs offer functions through keyboard shortcuts. DocBook can mark up these hotkeys using the following keyboard-related elements:
accelA shortcut key in a GUI:
<para>Sichern Sie Ihre Daten mittels <guimenu><accel>S</accel>peichern</guimenu>.</para>Ergebnis: Sichern Sie Ihre Daten mittels Speichern als....
keycapA key (explained below).
keycode,keysymAn internal identifier (
keycode) for a key, often numeric, and a symbolic name (keysym):
<para><keycap>F1</keycap> entspricht <keycode>0x3B</keycode> und hat den symbolischen Namen <keysym>KEY_F1</keysym> ...</para>Examples of keycap:
<keycombo>
<keycap>Strg</keycap>
<keycap>C</keycap>
</keycombo>For common keys such as Strg, Alt and others, use the attribute function (available from DocBook 4.3):
<keycombo>
<keycap function="ctrl">Strg</keycap>
<keycap>C</keycap>
</keycombo>This improves consistency and reduces translation work. The result is: Strg + C. Between Strg and C an additional character is inserted, varying by convention. Control it with the attribute action in keycap or keycombo. The following values are allowed:
clickindicates a single mouse click, possibly combined with another key.
double-clicklike the option
click, but requiring two quick mouse clicks, a double-click.pressA mouse click or key press.
seqA sequence: keys are pressed one after another rather than together.
simulSimultaneous key presses or mouse clicks.
otherAnother nonstandard action identified more precisely by the attribute
otheraction.
To mark up Emacs key combinations, write:
<para>Die Tastenkombination zum Speichern in Emacs lautet:
<keycombo action="seq">
<keycombo action="press">
<keycap>C</keycap><keycap>x</keycap>
</keycombo>
<keycombo action="press">
<keycap>C</keycap><keycap>s</keycap>
</keycombo>
...</para>The result is: Strg-x Strg-s.
shortcutA key combination also available through a menu item (see GUI-specific elements).
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top