mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 22:28:45 +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
|
// Don't block release/up events
|
||||||
case SDL_EVENT_MOUSE_MOTION:
|
case SDL_EVENT_MOUSE_MOTION:
|
||||||
case SDL_EVENT_MOUSE_WHEEL:
|
case SDL_EVENT_MOUSE_WHEEL:
|
||||||
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
case SDL_EVENT_MOUSE_BUTTON_DOWN: {
|
||||||
return GetIO().WantCaptureMouse;
|
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_TEXT_INPUT:
|
||||||
case SDL_EVENT_KEY_DOWN:
|
case SDL_EVENT_KEY_DOWN: {
|
||||||
return GetIO().WantCaptureKeyboard;
|
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_BUTTON_DOWN:
|
||||||
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
||||||
case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN:
|
case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue