]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
try to use volumup and volumdown
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 13 May 2014 12:29:47 +0000 (14:29 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 13 May 2014 12:29:47 +0000 (14:29 +0200)
android/AndroidManifest.xml
mainwindow.cpp

index 972a7e4ad67fef6ecc12a6fb7ceeda6d307db580..0b52f9eda08b4e99f988ec77aa522c0e357f257b 100644 (file)
@@ -44,4 +44,5 @@
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
     <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
+<uses-permission android:name="android.permission.BIND_INPUT_METHOD"/>
 </manifest>
index 327c76bdffc4fcae2a707fb7eb09919825e358ce..47f488ed7e3ee6a9ba19c301cde971a59a2409ed 100644 (file)
@@ -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="<<k;
-    if (k==Qt::Key_Back)
-    {
+    if(k==Qt::Key_Back){
         back();
-        //accepted=false;// close the app next time when the user press back button
-    }
+        }
     else if(k==Qt::Key_VolumeDown){
+        qDebug()<<"keyvolumdown";
         action(conf->value(QString("volumdown")).toString());
-    }
+
+        }
     else if(k==Qt::Key_VolumeUp){
         action(conf->value(QString("volumup")).toString());
-    }
-
-
+        };
 }
 void CLabel::SetTextToLabel(const QString& text)
 {