MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / dispatchKeyToModals

Function dispatchKeyToModals

src/visualizer/input/input_controller.cpp:142–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 bool dispatchKeyToModals(int key, int scancode, int action, int mods,
143 double x, double y, const bool over_gui) {
144 op::ModalEvent evt{};
145 evt.type = op::ModalEvent::Type::KEY;
146 evt.data = KeyEvent{key, scancode, action, mods};
147
148 if (op::operators().hasModalOperator()) {
149 const auto result = op::operators().dispatchModalEvent(evt);
150 if (result != op::OperatorResult::PASS_THROUGH) {
151 return true;
152 }
153 }
154
155 python::ModalEvent py_evt{};
156 py_evt.type = python::ModalEvent::Type::Key;
157 py_evt.key = key;
158 py_evt.action = action;
159 py_evt.mods = mods;
160 py_evt.x = x;
161 py_evt.y = y;
162 py_evt.over_gui = over_gui;
163
164 return python::dispatch_modal_event(py_evt);
165 }
166
167 bool dispatchMouseButtonToModals(int button, int action, int mods,
168 double x, double y, const bool over_gui) {

Callers 1

handleKeyMethod · 0.85

Calls 3

dispatch_modal_eventFunction · 0.85
hasModalOperatorMethod · 0.80
dispatchModalEventMethod · 0.80

Tested by

no test coverage detected