cgv
|
class to represent all possible mouse events with the EID_MOUSE More...
#include <mouse_event.h>
Public Member Functions | |
mouse_event (int x, int y, MouseAction _action, unsigned char _button_state=0, unsigned char _button=0, short _dx=0, short _dy=0, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0) | |
construct a mouse | |
void | stream_out (std::ostream &os) const |
write to stream | |
void | stream_in (std::istream &is) |
read from stream | |
short | get_x () const |
current mouse x position | |
short | get_y () const |
current mouse y position | |
short | get_dx () const |
for move and drag events the difference in x to the previous position | |
short | get_dy () const |
for move and drag events the difference in y to the previous position, for wheel events the amount the wheel has changed | |
MouseAction | get_action () const |
return the mouse action | |
unsigned char | get_button_state () const |
return the button state as values from MouseButton combined with a logical or-operation | |
unsigned char | get_button () const |
return the pressed or released button for a button press or release action | |
const std::string & | get_dnd_text () const |
only valid in a MA_RELEASE event with the flag MF_DND set, return the text resulting from the drag&drop action | |
void | set_x (short _x) |
set current mouse x position | |
void | set_y (short _y) |
set current mouse y position | |
void | set_dx (short _dx) |
set for move and drag events the difference in x to the previous position | |
void | set_dy (short _dy) |
set for move and drag events the difference in y to the previous position, for wheel events the amount the wheel has changed | |
void | set_action (MouseAction _action) |
return the mouse action | |
void | set_button_state (unsigned char _button_state) |
set the button state as values from MouseButton combined with a logical or-operation | |
void | set_button (unsigned char _button) |
set the pressed or released button for a button press or release action | |
void | set_dnd_text (const std::string &text) |
set the drag&drop text | |
virtual void * | get_device_id () const |
return the device id, by default returns 0 | |
void | set_kind (unsigned char _kind) |
set the kind of the event | |
unsigned | get_kind () const |
return, what kind of event this is, typically a value from the EventId enum | |
void | set_flags (unsigned char _flags) |
set the event flags More... | |
unsigned | get_flags () const |
return the event flags | |
void | set_modifiers (unsigned char _modifiers) |
set the modifiers | |
unsigned char | get_modifiers () const |
return the active modifiers as values from EventModifier combined with a logical or-operation | |
void | set_toggle_keys (unsigned char _toggle_keys) |
set the state of the toggle keys | |
unsigned char | get_toggle_keys () const |
return the state of the toggle keys as values from EventToggleKeys combined with a logical or-operation | |
void | set_time (const double &_time) |
set the time of the event | |
double | get_time () const |
return the time of the event in seconds | |
Protected Attributes | |
short | x |
x position of mouse pointer | |
short | y |
y position of mouse pointer | |
short | dx |
change in x position | |
short | dy |
change in y position | |
unsigned char | action |
store MouseAction | |
unsigned char | button_state |
store the button state | |
unsigned char | button |
store the pressed button | |
unsigned char | flags |
store mouse event flags | |
std::string | dnd_text |
the texted resulting from a drag and drop event | |
unsigned char | kind |
store which kind of event we have | |
unsigned char | modifiers |
store the active modifiers | |
unsigned char | toggle_keys |
store the active toggle keys | |
double | time |
store the time of the event in seconds | |
class to represent all possible mouse events with the EID_MOUSE
|
inherited |
set the event flags
return the set the event flags