14 #ifndef BUTTONTHROWER_H 15 #define BUTTONTHROWER_H 40 INLINE
void set_button_down_event(
const std::string &button_down_event);
41 INLINE
const std::string &get_button_down_event()
const;
42 INLINE
void set_button_up_event(
const std::string &button_up_event);
43 INLINE
const std::string &get_button_up_event()
const;
44 INLINE
void set_button_repeat_event(
const std::string &button_repeat_event);
45 INLINE
const std::string &get_button_repeat_event()
const;
46 INLINE
void set_keystroke_event(
const std::string &keystroke_event);
47 INLINE
const std::string &get_keystroke_event()
const;
48 INLINE
void set_candidate_event(
const std::string &candidate_event);
49 INLINE
const std::string &get_candidate_event()
const;
50 INLINE
void set_move_event(
const std::string &move_event);
51 INLINE
const std::string &get_move_event()
const;
52 INLINE
void set_raw_button_down_event(
const std::string &raw_button_down_event);
53 INLINE
const std::string &get_raw_button_down_event()
const;
54 INLINE
void set_raw_button_up_event(
const std::string &raw_button_up_event);
55 INLINE
const std::string &get_raw_button_up_event()
const;
56 MAKE_PROPERTY(button_down_event, get_button_down_event, set_button_down_event);
57 MAKE_PROPERTY(button_up_event, get_button_up_event, set_button_up_event);
58 MAKE_PROPERTY(button_repeat_event, get_button_repeat_event, set_button_repeat_event);
59 MAKE_PROPERTY(keystroke_event, get_keystroke_event, set_keystroke_event);
60 MAKE_PROPERTY(candidate_event, get_candidate_event, set_candidate_event);
61 MAKE_PROPERTY(move_event, get_move_event, set_move_event);
62 MAKE_PROPERTY(raw_button_down_event, get_raw_button_down_event, set_raw_button_down_event);
63 MAKE_PROPERTY(raw_button_up_event, get_raw_button_up_event, set_raw_button_up_event);
65 INLINE
void set_prefix(
const std::string &prefix);
66 INLINE
const std::string &get_prefix()
const;
67 INLINE
void set_specific_flag(
bool specific_flag);
68 INLINE
bool get_specific_flag()
const;
69 MAKE_PROPERTY(prefix, get_prefix, set_prefix);
70 MAKE_PROPERTY(specific_flag, get_specific_flag, set_specific_flag);
72 INLINE
void set_time_flag(
bool time_flag);
73 INLINE
bool get_time_flag()
const;
74 MAKE_PROPERTY(time_flag, get_time_flag, set_time_flag);
77 int get_num_parameters()
const;
79 MAKE_SEQ(get_parameters, get_num_parameters, get_parameter);
80 MAKE_SEQ_PROPERTY(parameters, get_num_parameters, get_parameter);
84 MAKE_PROPERTY(modifier_buttons, get_modifier_buttons, set_modifier_buttons);
86 INLINE
void set_throw_buttons_active(
bool flag);
87 INLINE
bool get_throw_buttons_active()
const;
88 MAKE_PROPERTY(throw_buttons_active, get_throw_buttons_active, set_throw_buttons_active);
94 void clear_throw_buttons();
97 virtual void write(std::ostream &out,
int indent_level = 0)
const;
100 void do_specific_event(
const std::string &event_name,
double time);
101 void do_general_event(
const ButtonEvent &button_event,
102 const std::string &event_name);
105 std::string _button_down_event;
106 std::string _button_up_event;
107 std::string _button_repeat_event;
108 std::string _keystroke_event;
109 std::string _candidate_event;
110 std::string _move_event;
111 std::string _raw_button_up_event;
112 std::string _raw_button_down_event;
124 bool _throw_buttons_active;
134 int _button_events_input;
137 int _button_events_output;
144 static void init_type() {
145 DataNode::init_type();
147 DataNode::get_class_type());
150 return get_class_type();
152 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
The fundamental type of node for the data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An optional parameter associated with an event.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encapsulates the data generated from (or sent into) any particular DataNode.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...