-class event
-{
-public:
- typedef enum
- {
- left_click_down = 1<<1,
- left_click_up = 1<<2,
- right_click_down = 1<<3,
- right_click_up = 1<<4,
- other_click_down = 1<<5,
- other_click_up = 1<<6,
- mouse_moved = 1<<7,
- mouse_entered = 1<<8,
- mouse_exited = 1<<9,
- key_down = 1<<10,
- key_up = 1<<11,
- activated = 1<<12,
- iconified = 1<<13,
- deactivated = 1<<14,
-
- file_new = 1<<20,
- file_open = 1<<21,
- file_revert = 1<<22,
- file_save = 1<<23,
- file_save_as = 1<<24,
- edit_undo = 1<<25,
- edit_redo = 1<<26,
- edit_copy = 1<<27,
- edit_cut = 1<<28,
- edit_paste = 1<<29,
- edit_select_all = 1<<30,
- app_quit = 1<<31,
- any = 0xffffffffU
- } type;
-
- // This constructor is for keyboard events:
- event( type theType, // What happened?
- unsigned char keycode, // The ASCII value.
- int modifiers, // Ctrl, Shift, Opt, etc...
- bool isRepeat ) : // Is the key held down?
- type_(theType), keycode_(keycode), modifiers_(modifiers),
- isRepeat_(isRepeat)
- {
- timestamp_ = date();
- id_ = getIdentifier();
- }
-
- // This constructor is for mouse events:
- event( type theType, // What happened?
- vec2d location, // Where? (window coordinates)
- vec2d delta, // How far has it moved?
- int nClick, // How many consecutive clicks?
- float pressure ) : // How hard was it pushed?
- type_(theType), location_(location), delta_(delta), nClick_(nClick),
- pressure_(pressure)
- {
- timestamp_ = date();
- id_ = getIdentifier();
- }