MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / EditBoxInGlobalFocus

Function EditBoxInGlobalFocus

src/window.cpp:449–457  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

447 * @return returns true if an edit box is in global focus or if the focused window is a console, else false
448 */
449bool 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.

Callers 8

InitializeDataMethod · 0.85
HandleKeypressFunction · 0.85
HandleTextInputFunction · 0.85
HandleKeyScrollingFunction · 0.85
SetCompositionPosFunction · 0.85
SetCandidatePosFunction · 0.85
WndProcGdiFunction · 0.85
PollEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected