diff --git a/source/RobotAPI/gui-plugins/PlatformUnitPlugin/PlatformUnitGuiPlugin.cpp b/source/RobotAPI/gui-plugins/PlatformUnitPlugin/PlatformUnitGuiPlugin.cpp index 5ca47be1fbe5e20dde1d81358b18878e563f0525..e4f3007ce7a9a69bd048b32b990f1386ff133297 100644 --- a/source/RobotAPI/gui-plugins/PlatformUnitPlugin/PlatformUnitGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/PlatformUnitPlugin/PlatformUnitGuiPlugin.cpp @@ -262,6 +262,36 @@ void PlatformUnitWidget::controlPlatformWithKeyboard(int key) void PlatformUnitWidget::stopPlatformWithKeyboard(int key) { + + QPointF position = speedCtrl->getPosition(); + QPointF rotation = rotaCtrl->getPosition(); + switch (key) + { + case Qt::Key_A: + rotation.rx() = 1; + break; + case Qt::Key_W: + position.ry() -= -1; + break; + case Qt::Key_S: + position.ry() += -1; + break; + case Qt::Key_D: + rotation.rx() = -1; + break; + case Qt::Key_Q: + position.rx() -= -1; + break; + case Qt::Key_E: + position.rx() += -1; + break; + default: + break; + } + + speedCtrl->setNibble(position); + rotaCtrl->setNibble(rotation); + pressedKeys.remove(key); if (pressedKeys.size() == 0) {