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

Function HandleTextInput

src/window.cpp:2739–2744  ·  view source on GitHub ↗

* Handle text input. * @param str Text string to input. * @param marked Is the input a marked composition string from an IME? * @param caret Move the caret to this point in the insertion string. */

Source from the content-addressed store, hash-verified

2737 * @param caret Move the caret to this point in the insertion string.
2738 */
2739void HandleTextInput(std::string_view str, bool marked, std::optional<size_t> caret, std::optional<size_t> insert_location, std::optional<size_t> replacement_end)
2740{
2741 if (!EditBoxInGlobalFocus()) return;
2742
2743 _focused_window->InsertTextString(_focused_window->window_class == WC_CONSOLE ? 0 : _focused_window->nested_focus->GetIndex(), str, marked, caret, insert_location, replacement_end);
2744}
2745
2746/**
2747 * If needed and switched on, perform auto scrolling (automatically

Callers 4

HandleIMECompositionFunction · 0.85
CancelIMECompositionFunction · 0.85
WndProcGdiFunction · 0.85
PollEventMethod · 0.85

Calls 3

EditBoxInGlobalFocusFunction · 0.85
InsertTextStringMethod · 0.45
GetIndexMethod · 0.45

Tested by

no test coverage detected