15#include "inputDeviceNode.h"
22InputDeviceNode(
InputDevice *device,
const std::string &name) :
26 _button_events_output = define_output(
"button_events", ButtonEventList::get_class_type());
57 if (_device ==
nullptr || !_device->is_connected()) {
64 if (_device->has_button_event()) {
65 PT(ButtonEventList) bel = _device->get_button_events();
68 for (
int i = 0; i < bel->get_num_events(); ++i) {
69 const ButtonEvent &
event = bel->get_event(i);
70 if (event._type == ButtonEvent::T_down) {
71 _button_states[
event._button] =
true;
72 }
else if (event._type == ButtonEvent::T_up) {
73 _button_states[
event._button] =
false;
77 output.set_data(_button_events_output, EventParameter(bel));
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...
Encapsulates the data generated from (or sent into) any particular DataNode.
The fundamental type of node for the data graph.
void output(std::ostream &out) const
Outputs the Namable.
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.