26 MouseInterfaceNode(
const std::string &name) :
29 _button_events_input = define_input(
"button_events", ButtonEventList::get_class_type());
36 ~MouseInterfaceNode() {
55 _required_buttons_state.
button_up(button);
66 _required_buttons_state.
button_up(button);
96 void MouseInterfaceNode::
119 bool &required_buttons_match) {
122 if (input.
has_data(_button_events_input)) {
123 DCAST_INTO_R(button_events, input.
get_data(_button_events_input).
get_ptr(),
nullptr);
127 required_buttons_match =
128 (_current_button_state & _required_buttons_mask) == _required_buttons_state;
130 return button_events;
Encapsulates the data generated from (or sent into) any particular DataNode.
const EventParameter & get_data(int index) const
Extracts the data for the indicated index, if it has been stored, or the empty parameter if it has no...
bool has_data(int index) const
Returns true if the indicated parameter has been stored, false otherwise.
The fundamental type of node for the data graph.
TypedWritableReferenceCount * get_ptr() const
Retrieves a pointer to the actual value stored in the parameter.
void clear_button(const ButtonHandle &button)
Removes any requirement on the indicated button set by an earlier call to require_button().
void clear_all_buttons()
Removes all requirements on buttons set by an earlier call to require_button().
void require_button(const ButtonHandle &button, bool is_down)
Indicates that the indicated button must be in the required state (either up or down) in order for th...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.