73 event(
unsigned int _kind =
EID_NONE,
unsigned char _modifiers = 0,
unsigned char _toggle_keys = 0,
double _time = 0);
77 virtual void stream_out(std::ostream& os)
const;
79 virtual void stream_in(std::istream& is);
81 virtual void* get_device_id()
const;
83 void set_kind(
unsigned char _kind);
85 unsigned get_kind()
const;
88 void set_flags(
unsigned char _flags);
90 unsigned get_flags()
const;
92 void set_modifiers(
unsigned char _modifiers);
94 unsigned char get_modifiers()
const;
96 void set_toggle_keys(
unsigned char _toggle_keys);
98 unsigned char get_toggle_keys()
const;
100 void set_time(
const double& _time);
102 double get_time()
const;
115 extern CGV_API
void stream_in_toggle_keys(std::istream& is,
unsigned char& toggle_keys);
123 #include <cgv/config/lib_end.h>
@ EF_PAD
whether event is from gamepad
Definition: event.h:34
@ ETK_CAPS_LOCK
caps lock
Definition: event.h:51
@ EID_LIFETIME
id for nui life time
Definition: event.h:25
unsigned char toggle_keys
store the active toggle keys
Definition: event.h:68
unsigned char stream_in_modifiers(std::istream &is)
read modifiers in string format from a stream and set the passed reference to EventModifier s ored to...
Definition: event.cxx:126
std::string get_toggle_keys_string(EventToggleKeys toggle_keys)
convert a toggle key combination into a readable string separated by '+' signs, i....
Definition: event.cxx:47
unsigned char flags
store event flags
Definition: event.h:64
EventId
define the ids of the most common events
Definition: event.h:15
@ EID_CHOICE
id for focus or selection change events
Definition: event.h:22
@ EF_VR
whether event is from VR kit
Definition: event.h:35
@ EID_ACTION
id for nui action events
Definition: event.h:24
@ EF_NUI
whether event is nature user interface event
Definition: event.h:36
std::string get_modifier_string(EventModifier modifiers)
convert a modifier combination into a readable string ending on a '+' sign if not empty,...
Definition: event.cxx:37
unsigned char modifiers
store the active modifiers
Definition: event.h:66
@ EF_MULTI
whether event is tagged with id of the device that generated the event
Definition: event.h:32
EventFlags
flags
Definition: event.h:30
@ EID_STICK
id of a stick event describing a two axis controller that optionally can be touched and pressed
Definition: event.h:20
@ ETK_NUM_LOCK
num lock
Definition: event.h:52
@ EM_SHIFT
shift modifier
Definition: event.h:42
unsigned char kind
store which kind of event we have
Definition: event.h:62
@ EID_NONE
undefined event id
Definition: event.h:16
@ EID_POSE
id for a 6D pose change events
Definition: event.h:21
@ EF_DND
whether mouse has a drag and drop target attached
Definition: event.h:33
@ EM_ALT
alt modifier
Definition: event.h:43
double time
store the time of the event in seconds
Definition: event.h:70
@ ETK_SCROLL_LOCK
scroll lock
Definition: event.h:53
@ EM_CTRL
ctrl modifier
Definition: event.h:44
EventModifier
define constants for event modifiers
Definition: event.h:41
@ EID_MOUSE
id for mouse event
Definition: event.h:18
unsigned char & ref_current_modifiers()
read out the current modifiers
Definition: event.cxx:252
the cgv namespace
Definition: vr_calib.cxx:9
@ EM_META
meta modifier (windows or mac key)
Definition: event.h:45
@ EID_KEY
id for key event
Definition: event.h:17
@ EID_THROTTLE
id of throttle event describing a one axis controller
Definition: event.h:19
EventToggleKeys
define constants for toggle keys
Definition: event.h:50
@ EID_APPROACH
id for nui approach events
Definition: event.h:23