Commit c264de6f authored by Marius Bock's avatar Marius Bock

sad

parent fcc74691
......@@ -23,8 +23,8 @@ public:
*/
bool init();
Key getKeyDown();
bool isKeyUp();
Key getKeyPressed();
bool isKeyReleased();
void checkKeys();
private:
......
......@@ -56,14 +56,14 @@ int main(int argc, char** argv) {
helper.checkKeys();
// Stop the robot on any keyup
if (helper.isKeyUp()) {
if (helper.isKeyReleased()) {
crs::ER1ControlMsg msg;
msg.er1command = crs::ER1ControlMsg::ER1CommandStop;
publisher.publish(msg);
}
// Send command if keydown
auto key = helper.getKeyDown();
auto key = helper.getKeyPressed();
if (key == Key::None) {
} else if (key == Key::Left) {
......
......@@ -57,7 +57,7 @@ int main(int argc, char** argv) {
helper.checkKeys();
// Stop the robot on any keyup
if (helper.isKeyUp()) {
if (helper.isKeyReleased()) {
crs::ER1ControlMsg msg;
msg.er1command = crs::ER1ControlMsg::ER1CommandStop;
publisher.publish(msg);
......
......@@ -24,7 +24,7 @@ bool CRSInputHelper::init() {
}
Key CRSInputHelper::getKeyDown() {
Key CRSInputHelper::getKeyPressed() {
if (hasNewKeyDown) {
hasNewKeyDown = false;
return static_cast<Key>(currentDown);
......@@ -33,7 +33,7 @@ Key CRSInputHelper::getKeyDown() {
}
}
bool CRSInputHelper::isKeyUp() {
bool CRSInputHelper::isKeyReleased() {
if (hasNewKeyUp) {
hasNewKeyUp = false;
return true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment