MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / input_text_key_callback

Method input_text_key_callback

src/GUIStuff/Elements/TextBox.impl.hpp:140–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140template <typename T> void TextBox<T>::input_text_key_callback(const InputManager::KeyCallbackArgs& key) {
141 if(is_selected()) {
142 if(key.key == InputManager::KEY_GENERIC_ENTER && key.down) {
143 bool success = update_data();
144 gui.set_post_callback_func_high_priority([&, success] {
145 if(success && userInfo.onEdit) userInfo.onEdit();
146 if(userInfo.onEnter) userInfo.onEnter();
147 reset_textbox_text();
148 if(is_selected()) edit->android_force_update_textbox_and_cursor();
149 });
150 }
151 else {
152 if(edit->input_key_callback(*gui.io.input, key).textEdited)
153 after_text_input_callback();
154 }
155 }
156}
157
158template <typename T> void TextBox<T>::populate_empty_textbox() {
159 if(!is_selected() && isEmptyText && !userInfo.emptyText.empty()) {

Callers

nothing calls this directly

Tested by

no test coverage detected