| 138 | } |
| 139 | |
| 140 | template <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 | |
| 158 | template <typename T> void TextBox<T>::populate_empty_textbox() { |
| 159 | if(!is_selected() && isEmptyText && !userInfo.emptyText.empty()) { |
nothing calls this directly
no test coverage detected