From: Olivier Matz Date: Sun, 7 Jun 2015 16:55:01 +0000 (+0200) Subject: add some keyboard shortcuts X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=beaf3b70701f7c8a1f7e55549aba2a3d4cfb2ad8;p=fpv.git add some keyboard shortcuts --- diff --git a/qtosd/qtosd.py b/qtosd/qtosd.py index 997934d..35e4e75 100644 --- a/qtosd/qtosd.py +++ b/qtosd/qtosd.py @@ -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))