mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 17:19:28 +01:00
UI: A press and release in one event is a press only for the top screen
Key ups go to every screen, so keys don't get stuck, and that included events that are a press and a release at once, like iOS's back swipe. So with settings open from the pause menu, a back swipe made the pause screen try to close too. It isn't on top, so finishDialog refused, but the screen had already stopped taking input, and once settings closed it was left on top, ignoring everything. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
da33eab776
commit
f795f7e07f
1 file changed
+6
-3
@@ -106,10 +106,13 @@ void ScreenManager::ProcessInputEvent(const QueuedEvent &event) {
|
||||
case QueuedEventType::KEY:
|
||||
{
|
||||
const KeyInput &key = event.key;
|
||||
// Send key up to every screen layer, to avoid stuck keys.
|
||||
// Send key up to every screen layer, to avoid stuck keys. A press and release in one (iOS's back swipe,
|
||||
// the mouse wheel) is a press only for the top one, or every dialog below would act on it too.
|
||||
if (key.flags & KeyInputFlags::UP) {
|
||||
for (auto &layer : stack_) {
|
||||
layer.screen->key(key);
|
||||
KeyInput upOnly = key;
|
||||
upOnly.flags &= ~KeyInputFlags::DOWN;
|
||||
for (size_t i = 0; i < stack_.size(); i++) {
|
||||
stack_[i].screen->key(i == stack_.size() - 1 ? key : upOnly);
|
||||
}
|
||||
} else if (!stack_.empty()) {
|
||||
stack_.back().screen->key(key);
|
||||
|
||||
Reference in new issue
Block a user