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

Method onButton

src/ui/TextField.cpp:101–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void TextField::onButton(const ButtonEvent& e) {
102 OpaqueWidget::onButton(e);
103
104 if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
105 cursor = selection = getTextPosition(e.pos);
106 }
107
108 if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_RIGHT) {
109 createContextMenu();
110 e.consume(this);
111 }
112}
113
114void TextField::onSelectText(const SelectTextEvent& e) {
115 std::u32string s32(1, char32_t(e.codepoint));

Callers

nothing calls this directly

Calls 1

consumeMethod · 0.80

Tested by

no test coverage detected