mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
imgui: dont capture any input without an active nav window
fix keyboard not being available as soon as the emulator opens
This commit is contained in:
parent
76644a0169
commit
11c52b3330
1 changed files with 10 additions and 4 deletions
|
@ -148,11 +148,17 @@ bool ProcessEvent(SDL_Event* event) {
|
|||
// Don't block release/up events
|
||||
case SDL_EVENT_MOUSE_MOTION:
|
||||
case SDL_EVENT_MOUSE_WHEEL:
|
||||
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
||||
return GetIO().WantCaptureMouse;
|
||||
case SDL_EVENT_MOUSE_BUTTON_DOWN: {
|
||||
const auto& io = GetIO();
|
||||
return io.WantCaptureMouse && io.Ctx->NavWindow != nullptr &&
|
||||
io.Ctx->NavWindow->ID != dock_id;
|
||||
}
|
||||
case SDL_EVENT_TEXT_INPUT:
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
return GetIO().WantCaptureKeyboard;
|
||||
case SDL_EVENT_KEY_DOWN: {
|
||||
const auto& io = GetIO();
|
||||
return io.WantCaptureKeyboard && io.Ctx->NavWindow != nullptr &&
|
||||
io.Ctx->NavWindow->ID != dock_id;
|
||||
}
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_DOWN:
|
||||
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
||||
case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN:
|
||||
|
|
Loading…
Add table
Reference in a new issue