]> git.droids-corp.org - fpv.git/commitdiff
add some keyboard shortcuts
authorOlivier Matz <zer0@droids-corp.org>
Sun, 7 Jun 2015 16:55:01 +0000 (18:55 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 7 Jun 2015 16:55:01 +0000 (18:55 +0200)
qtosd/qtosd.py

index 997934dc24a7b1189b60cb21deef94a2b2298c45..35e4e754fe78417c78fa420c6438d433826f71e6 100644 (file)
@@ -679,6 +679,25 @@ class Ui_MainWindow(QMainWindow):
         self.ui.yawSlider.valueChanged[int].connect(self.changeYaw)
         self.ui.actionExit.triggered.connect(self.close)
 
+    def keyPressEvent(self, event):
+        if event.key() == Qt.Key_J:
+            self.osd.setRoll(self.osd.user_roll + 2)
+            event.accept()
+        elif event.key() == Qt.Key_L:
+            self.osd.setRoll(self.osd.user_roll - 2)
+            event.accept()
+        elif event.key() == Qt.Key_I:
+            self.osd.setPitch(self.osd.user_pitch + 2)
+            event.accept()
+        elif event.key() == Qt.Key_K:
+            self.osd.setPitch(self.osd.user_pitch - 2)
+            event.accept()
+        elif event.key() == Qt.Key_Q:
+            self.close()
+
+    def keyReleaseEvent(self, event):
+        return
+
     def retranslateUi(self, MainWindow):
         MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))