Qt Android get Home and recent Apps button press

794 Views Asked by At

I need to turn our Qt-Android App into a kind of Kiosk-App so the App wont close anymore if the user presses The home, back or recent apps button. Our App will be displayed on all kinds of TVs or tablets and it should just not be exitable by a user who isnt allowed to exit it.

The back Button was pretty easy to handle actually

bool Application::notify(QObject* object, QEvent* event)
{

...

#ifndef Q_OS_ANDROID
if (event->type() == QEvent::KeyPress) {
    QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
    if (keyEvent->key() == Qt::Key_Back)
    {
        qDebug() << "back key got pressed!";
        keyEvent->accept();
        return true;
    }
}
#endif // Q_OS_ANDROID

...

}

this works for the Back Button.

My main problem is The Home and the Recent Apps button presses are not sent to the application. Is there ANY way to get those signals?

greetings Georg

0

There are 0 best solutions below