MCPcopy Create free account
hub / github.com/Norbyte/bg3se / SDLPollEventInternal

Method SDLPollEventInternal

BG3Extender/Extender/Client/SDL.cpp:107–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int SDLManager::SDLPollEventInternal(SDL_Event* event, int result)
108{
109 gExtender->OnSDLEvent(event);
110
111 if (enableUI_ && result == 1) {
112 {
113 std::lock_guard _(mutex_);
114 ImGui_ImplSDL2_ProcessEvent(event);
115 }
116
117 ImGuiIO& io = ImGui::GetIO();
118 if (io.WantTextInput
119 && (event->type == SDL_KEYDOWN || event->type == SDL_KEYUP || event->type == SDL_TEXTEDITING || event->type == SDL_TEXTINPUT)) {
120 result = 0;
121 }
122
123 if (io.WantCaptureMouse
124 && (event->type == SDL_MOUSEMOTION || event->type == SDL_MOUSEBUTTONDOWN || event->type == SDL_MOUSEBUTTONUP || event->type == SDL_MOUSEWHEEL)) {
125 result = 0;
126 }
127 }
128
129 if (result == 1 && gExtender->GetClient().HasExtensionState()) {
130 ecl::ExtensionState::Get().OnInputEvent(event, result);
131 }
132
133 return result;
134}
135
136void SDLManager::SDLIsTextInputActiveHooked(SDL_bool active)
137{

Callers

nothing calls this directly

Calls 4

OnSDLEventMethod · 0.80
GetClientMethod · 0.80
HasExtensionStateMethod · 0.45
OnInputEventMethod · 0.45

Tested by

no test coverage detected