Keyboard, mouse and GUI related elements

Several elements are used to surround words that represent GUI elements, keyboard keys or mouse buttons.

Keyboard and mouse

Table 1. Keyboard and mouse related elements

ElementDescriptionExample sourceExample output
<mousebutton>Name of a mouse button <mousebutton> Button1</mousebutton> Button1
<keycap>Text printed on a keyboard key <keycap> F1</keycap> F1
<keycode>Internal (numeric) identifier for a keyboard key <keycode> 0x3B</keycode> 0x3B
<keysym>Symbolic name of a keyboard key <keysym> KEY_F1</keysym> KEY_F1

The <keycombo> element can be used to represent a combination of input actions, through the mouse or keyboard. The action attribute can be used with the value seq to define a sequence of actions instead of a combination of actions.

Example 13. <keycombo> usage

<para>
  Press <keycombo action="seq">
    <keycombo>
      <keycap>Ctrl</keycap>
      <keycap>H</keycap>
    </keycombo>
    <keycap>T</keycap>
  </keycombo> to run the <application>Emacs</application> tutorial, 
  and <keycombo>
    <keycap>Ctrl</keycap>
    <mousebutton>Button3</mousebutton>
  </keycombo> to open the mode-specific menu.
</para>
Press Ctrl-H T to run the Emacs tutorial, 
and Ctrl-Button3 to open the mode-specific menu.

Graphical User Interface

Table 2. GUI related elements

ElementDescriptionExample sourceExample output
<guibutton>Text appearing on a GUI button <guibutton> OK</guibutton> OK
<guiicon>Graphic and/or text appearing on a GUI icon
<guiicon>
  <inlinemediaobject>
    <imageobject>
      <imagedata fileref="icon.eps" format="eps">
    </imageobject>
    <imageobject>
      <imagedata fileref="icon.jpg" format="jpg">
    </imageobject>
  </inlinemediaobject>
</guiicon>
<guilabel>Text of a GUI label <guilabel> Legend</guilabel> Legend
<guimenu>Name of a GUI menu <guimenu> Files</guimenu> Files
<guimenuitem>Name of a terminal GUI menu item <guimenuitem> Print Buffer</guimenuitem> Print Buffer
<guisubmenu>Name of a GUI submenu <guisubmenu> Text Properties</guisubmenu> Text Properties

It is possible to specify a keyboard shortcut for these six GUI related elements with the <accel> element.

A choice in a GUI menu is made of a series of selections through a menu, submenus and a menu item. It is possible to describe such a menu choice with the <menuchoice> element. It is also possible to specify a shortcut associated to this menu choice with the <menuchoice> element.

Example 14. Accel and menu choice

<menuchoice>
  <shortcut>
    <keycombo action=seq><keysym>C-x</keysym><keysym>C-c</keysym></keycombo>
  </shortcut>
  <guimenu><accel>F</accel>ile</guimenu>
  <guimenuitem>E<accel>x</accel>it</guimenuitem>
</menuchoice>
File->Exit (C-x C-c)