Skip to content

Commit f045f98

Browse files
committed
qt, android: Add GUIUtil::IsEscapeOrBack helper
1 parent 0b30bdd commit f045f98

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/qt/guiutil.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,15 @@ namespace GUIUtil
428428
*/
429429
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
430430

431+
inline bool IsEscapeOrBack(int key)
432+
{
433+
if (key == Qt::Key_Escape) return true;
434+
#ifdef Q_OS_ANDROID
435+
if (key == Qt::Key_Back) return true;
436+
#endif // Q_OS_ANDROID
437+
return false;
438+
}
439+
431440
} // namespace GUIUtil
432441

433442
#endif // BITCOIN_QT_GUIUTIL_H

0 commit comments

Comments
 (0)