MCPcopy Create free account
hub / github.com/VCVRack/Rack / handleText

Method handleText

src/widget/event.cpp:359–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool 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
382bool EventState::handleKey(math::Vec pos, int key, int scancode, int action, int mods) {
383 // Update heldKey state

Callers 1

charCallbackFunction · 0.80

Calls 2

onSelectTextMethod · 0.45
onHoverTextMethod · 0.45

Tested by

no test coverage detected