KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Event_listener Class Referenceabstract

#include <gui_event_listener.h>

Inheritance diagram for Event_listener:
kjb::gui::Interactive_object Null_event_listener

Public Member Functions

virtual bool mouse_event (int button, int state, int x, int y)=0
 
virtual bool mouse_double_event (int button, int state, int x, int y)=0
 
virtual bool motion_event (int x, int y)=0
 
virtual bool passive_motion_event (int x, int y)=0
 
virtual bool keyboard_event (unsigned int key, int x, int y)=0
 
virtual bool special_event (int key, int x, int y)=0
 

Detailed Description

Abstract interface for objects that can consume Glut interaction events (click, drag, hover, and keyboard). Method names and their signatures come from Glut's API e.g. the drag method is called "motion" after Glut's glutMotionFunc() function.

Returning "true" indicates that the function has consumed the event and other listeners won't receive it.

Member Function Documentation

virtual bool Event_listener::keyboard_event ( unsigned int  key,
int  x,
int  y 
)
pure virtual

Event called when ascii keys are pressed

Implemented in Null_event_listener.

virtual bool Event_listener::motion_event ( int  x,
int  y 
)
pure virtual

Event called when mouse is dragged

Implemented in Null_event_listener.

virtual bool Event_listener::mouse_double_event ( int  button,
int  state,
int  x,
int  y 
)
pure virtual

Event called when mouse is clicked

Implemented in Null_event_listener.

virtual bool Event_listener::mouse_event ( int  button,
int  state,
int  x,
int  y 
)
pure virtual

Event called when mouse is clicked

Implemented in Null_event_listener.

virtual bool Event_listener::passive_motion_event ( int  x,
int  y 
)
pure virtual

Event called when mouse is moved without clicking ("hover")

Implemented in Null_event_listener.

virtual bool Event_listener::special_event ( int  key,
int  x,
int  y 
)
pure virtual

Event called when other keys are pressed (arrows, pgup, f1, f2, ...)

Implemented in Null_event_listener.


The documentation for this class was generated from the following file: