Chapter 12. Handling Events

Table of Contents
The FLTK Event Model
Mouse Events
Focus Events
Keyboard Events
Widget Events
Clipboard Events
Fl::event_*() methods
Event Propagation
FLTK Compose-Character Sequences

This chapter discusses the FLTK event model and how to handle events in your program or widget.

The FLTK Event Model

Events are identified by the integer argument passed to the Fl_Widget::handle() virtual method. Other information about the most recent event is stored in static locations and acquired by calling the Fl::event_*() methods. This static information remains valid until the next event is read from window system (i.e. it is ok to look at it outside of the handle() method).