Operation Manual

Toolbars, menu items, and keyboard shortcuts
To add a menu item, keyboard shortcut, or toolbar icon that calls a macro, use the Customize
dialog (Figure 340). The Customize dialog contains pages to configure menus, keyboard shortcuts,
toolbars, and events. To open this dialog, go to Tools > Customize on the main menu bar or right-
click in an empty space on a toolbar and select Customize Toolbar from the context menu.
Complete coverage of the Customize dialog is beyond the scope of this chapter. Click the Help
button to access the help pages included with LibreOffice or see Chapter 14 Customizing
LibreOffice.
Figure 340: Menus page in Customize dialog
Events
Whenever something happens in LibreOffice, it is called an event. For example, opening a
document, pressing a key, or moving the mouse cursor are all events. LibreOffice allows events to
trigger the execution of a macro; the macro is then called an event handler. Full coverage of event
handlers is well beyond the scope of this document, but a little knowledge can accomplish much.
Caution
Be careful when you configure an event handler. For example, assume that you write
an event handler that is called every time that a key is pressed, but you make a
mistake so the event is not properly handled. One possible result is that your event
handler will consume all key presses, forcing you to kill LibreOffice.
Chapter 13 Getting Started with Macros | 357