From acf18ed0dcd3bfe3924945271802273f087930f7 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Tue, 13 May 2014 14:29:47 +0200 Subject: [PATCH] try to use volumup and volumdown --- android/AndroidManifest.xml | 1 + mainwindow.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 972a7e4..0b52f9e 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -44,4 +44,5 @@ + diff --git a/mainwindow.cpp b/mainwindow.cpp index 327c76b..47f488e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -311,6 +311,8 @@ void MainWindow::firstrun(){ conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from ui where id=?;")); conf->setValue(QString("updatebuttons"), QVariant("update ui set keyword=?, label=?, action=? where id=?;")); conf->setValue(QString("deletebuttons"), QVariant("delete from ui where id=?")); + conf->setValue(QString("volumdown"), QVariant("config")); + conf->setValue(QString("volumup"), QVariant("config")); qDebug()<<"firstrun() finished"; } QString &MainWindow::get(int row, int column){ @@ -488,22 +490,20 @@ void MainWindow::back(){ void MainWindow::keyReleaseEvent(QKeyEvent *event) { //static bool accepted=true; - event->setAccepted(true); // don't close my Top Level Widget ! + event->setAccepted(1); int k=event->key(); qDebug()<<"key pressed="<value(QString("volumdown")).toString()); - } + + } else if(k==Qt::Key_VolumeUp){ action(conf->value(QString("volumup")).toString()); - } - - + }; } void CLabel::SetTextToLabel(const QString& text) { -- 2.45.1