| 1149 | } |
| 1150 | |
| 1151 | EventState OnKeyPress([[maybe_unused]] char32_t key, uint16_t keycode) override |
| 1152 | { |
| 1153 | /* ESC closes the window, Enter confirms the action */ |
| 1154 | switch (keycode) { |
| 1155 | case WKC_RETURN: |
| 1156 | case WKC_NUM_ENTER: |
| 1157 | if (this->proc != nullptr) { |
| 1158 | this->proc(this->parent, true); |
| 1159 | this->proc = nullptr; |
| 1160 | } |
| 1161 | [[fallthrough]]; |
| 1162 | |
| 1163 | case WKC_ESC: |
| 1164 | this->Close(); |
| 1165 | return ES_HANDLED; |
| 1166 | } |
| 1167 | return ES_NOT_HANDLED; |
| 1168 | } |
| 1169 | }; |
| 1170 | |
| 1171 | static constexpr std::initializer_list<NWidgetPart> _nested_query_widgets = { |