| 357 | } |
| 358 | |
| 359 | bool EventState::handleText(math::Vec pos, uint32_t codepoint) { |
| 360 | if (selectedWidget) { |
| 361 | // Dispatch SelectTextEvent |
| 362 | EventContext cSelectText; |
| 363 | Widget::SelectTextEvent eSelectText; |
| 364 | eSelectText.context = &cSelectText; |
| 365 | eSelectText.codepoint = codepoint; |
| 366 | selectedWidget->onSelectText(eSelectText); |
| 367 | if (cSelectText.target) |
| 368 | return true; |
| 369 | } |
| 370 | |
| 371 | // Dispatch HoverText |
| 372 | EventContext cHoverText; |
| 373 | Widget::HoverTextEvent eHoverText; |
| 374 | eHoverText.context = &cHoverText; |
| 375 | eHoverText.pos = pos; |
| 376 | eHoverText.codepoint = codepoint; |
| 377 | rootWidget->onHoverText(eHoverText); |
| 378 | |
| 379 | return !!cHoverText.target; |
| 380 | } |
| 381 | |
| 382 | bool EventState::handleKey(math::Vec pos, int key, int scancode, int action, int mods) { |
| 383 | // Update heldKey state |
no test coverage detected