From f045f987171c3960c12813538b9f19a54a50b4f8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 3 Dec 2021 01:02:10 +0200 Subject: qt, android: Add GUIUtil::IsEscapeOrBack helper --- src/qt/guiutil.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/qt/guiutil.h') diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 211f3f506d..364962ee9a 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -428,6 +428,15 @@ namespace GUIUtil */ void ShowModalDialogAndDeleteOnClose(QDialog* dialog); + inline bool IsEscapeOrBack(int key) + { + if (key == Qt::Key_Escape) return true; +#ifdef Q_OS_ANDROID + if (key == Qt::Key_Back) return true; +#endif // Q_OS_ANDROID + return false; + } + } // namespace GUIUtil #endif // BITCOIN_QT_GUIUTIL_H -- cgit v1.2.3