19 TypeHandle GraphicsWindowInputDevice::_type_handle;
31 GraphicsWindowInputDevice::
32 GraphicsWindowInputDevice(
GraphicsWindow *host,
const string &name,
bool pointer,
bool keyboard) :
36 enable_feature(Feature::pointer);
37 add_pointer(PointerType::mouse, 0);
40 enable_feature(Feature::keyboard);
77 _button_events->add_event(
ButtonEvent(button, ButtonEvent::T_down, time));
78 _buttons_held.insert(button);
89 _button_events->add_event(
ButtonEvent(button, ButtonEvent::T_resume_down, time));
90 _buttons_held.insert(button);
99 _button_events->add_event(
ButtonEvent(button, ButtonEvent::T_up, time));
100 _buttons_held.erase(button);
109 _button_events->add_event(
ButtonEvent(keycode, time));
118 candidate(
const std::wstring &candidate_string,
size_t highlight_start,
119 size_t highlight_end,
size_t cursor_pos) {
121 _button_events->add_event(
ButtonEvent(candidate_string,
122 highlight_start, highlight_end,
136 ButtonsHeld::iterator bi;
137 for (bi = _buttons_held.begin(); bi != _buttons_held.end(); ++bi) {
138 _button_events->add_event(
ButtonEvent(*bi, ButtonEvent::T_up, time));
140 _buttons_held.clear();
149 _button_events->add_event(
ButtonEvent(button, ButtonEvent::T_raw_down, time));
158 _button_events->add_event(
ButtonEvent(button, ButtonEvent::T_raw_up, time));
170 data._type = PointerType::mouse;
173 data._in_window =
true;
174 InputDevice::update_pointer(data, time);
184 if (_pointers.empty()) {
188 _pointers[0]._in_window =
false;
189 _pointers[0]._pressure = 0.0;
191 if (_enable_pointer_events) {
192 int seq = _event_sequence++;
193 if (_pointer_events.is_null()) {
196 _pointer_events->add_event(_pointers[0]._in_window,
Records a set of pointer events that happened recently.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
Similar to MutexHolder, but for a light mutex.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Holds the data that might be generated by a 2-d pointer input device, such as the mouse in the Graphi...
TypeHandle is the identifier used to differentiate C++ class types.