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

Method onSelectKey

src/app/Browser.cpp:851–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

849}
850
851inline void BrowserSearchField::onSelectKey(const SelectKeyEvent& e) {
852 if (e.action == GLFW_PRESS || e.action == GLFW_REPEAT) {
853 // Backspace when the field is empty to clear filters.
854 if (e.isKeyCommand(GLFW_KEY_BACKSPACE) || e.isKeyCommand(GLFW_KEY_BACKSPACE, RACK_MOD_CTRL)) {
855 if (text == "") {
856 browser->clear();
857 e.consume(this);
858 }
859 }
860 }
861
862 if (!e.getTarget())
863 ui::TextField::onSelectKey(e);
864}
865
866inline void BrowserSearchField::onChange(const ChangeEvent& e) {
867 browser->search = string::trim(text);

Callers 1

handleKeyMethod · 0.45

Calls 4

isKeyCommandMethod · 0.80
consumeMethod · 0.80
getTargetMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected