From 5023f2cb6c934c92af57c8f9e297e797b847d571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 14 Jul 2023 12:01:38 +0200 Subject: [PATCH] Fix key event processing issue. Fixes #17712 --- Common/UI/Root.cpp | 4 ++-- Common/UI/Root.h | 2 +- Common/UI/UIScreen.cpp | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Common/UI/Root.cpp b/Common/UI/Root.cpp index aa4c08d2c9..3a34aff6f0 100644 --- a/Common/UI/Root.cpp +++ b/Common/UI/Root.cpp @@ -263,8 +263,8 @@ KeyEventResult UnsyncKeyEvent(const KeyInput &key, ViewGroup *root) { return retval; } -void KeyEvent(const KeyInput &key, ViewGroup *root) { - root->Key(key); +bool KeyEvent(const KeyInput &key, ViewGroup *root) { + return root->Key(key); } void TouchEvent(const TouchInput &touch, ViewGroup *root) { diff --git a/Common/UI/Root.h b/Common/UI/Root.h index 0e8d4e7d63..3454525431 100644 --- a/Common/UI/Root.h +++ b/Common/UI/Root.h @@ -33,7 +33,7 @@ enum class KeyEventResult { // Hooks arrow keys for navigation KeyEventResult UnsyncKeyEvent(const KeyInput &key, ViewGroup *root); -void KeyEvent(const KeyInput &key, ViewGroup *root); +bool KeyEvent(const KeyInput &key, ViewGroup *root); void TouchEvent(const TouchInput &touch, ViewGroup *root); void AxisEvent(const AxisInput &axis, ViewGroup *root); diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index a38ea30b4a..9fe4e44e1d 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -74,8 +74,7 @@ void UIScreen::axis(const AxisInput &axis) { bool UIScreen::key(const KeyInput &key) { if (!ignoreInput_ && root_) { - UI::KeyEvent(key, root_); - return false; + return UI::KeyEvent(key, root_); } else { return false; }