| 105 | } |
| 106 | |
| 107 | int 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 | |
| 136 | void SDLManager::SDLIsTextInputActiveHooked(SDL_bool active) |
| 137 | { |
nothing calls this directly
no test coverage detected