| 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) { |
no test coverage detected