0x004CE910
| 286 | |
| 287 | // 0x004CE910 |
| 288 | static bool keyUp(Window& w, uint32_t charCode, uint32_t keyCode) |
| 289 | { |
| 290 | if (charCode == SDLK_RETURN) |
| 291 | { |
| 292 | w.callOnMouseUp(Widx::ok, w.widgets[Widx::ok].id); |
| 293 | return true; |
| 294 | } |
| 295 | else if (charCode == SDLK_ESCAPE) |
| 296 | { |
| 297 | w.callOnMouseUp(Widx::close, w.widgets[Widx::close].id); |
| 298 | return true; |
| 299 | } |
| 300 | else if (!Input::isFocused(w.type, w.number, Widx::input) || !inputSession.handleInput(charCode, keyCode)) |
| 301 | { |
| 302 | return false; |
| 303 | } |
| 304 | |
| 305 | WindowManager::invalidate(WindowType::textInput, 0); |
| 306 | inputSession.cursorFrame = 0; |
| 307 | |
| 308 | int containerWidth = w.widgets[Widx::input].width() - 2; |
| 309 | if (inputSession.needsReoffsetting(containerWidth)) |
| 310 | { |
| 311 | inputSession.calculateTextOffset(containerWidth); |
| 312 | } |
| 313 | |
| 314 | return true; |
| 315 | } |
| 316 | |
| 317 | static constexpr WindowEventList kEvents = { |
| 318 | .onMouseUp = onMouseUp, |
nothing calls this directly
no test coverage detected