From: Norbert Moutarde Date: Tue, 13 May 2014 12:29:47 +0000 (+0200) Subject: try to use volumup and volumdown X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=acf18ed0dcd3bfe3924945271802273f087930f7;p=diary-mobile.git try to use volumup and volumdown --- 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) {