* Check if an edit box is in global focus. That is if focused window * has a edit box as focused widget, or if a console is focused. * @return returns true if an edit box is in global focus or if the focused window is a console, else false */
| 447 | * @return returns true if an edit box is in global focus or if the focused window is a console, else false |
| 448 | */ |
| 449 | bool EditBoxInGlobalFocus() |
| 450 | { |
| 451 | if (_focused_window == nullptr) return false; |
| 452 | |
| 453 | /* The console does not have an edit box so a special case is needed. */ |
| 454 | if (_focused_window->window_class == WC_CONSOLE) return true; |
| 455 | |
| 456 | return _focused_window->nested_focus != nullptr && _focused_window->nested_focus->type == WWT_EDITBOX; |
| 457 | } |
| 458 | |
| 459 | /** |
| 460 | * Check if a console is focused. |
no outgoing calls
no test coverage detected