diff --git a/src/Controllers/ConsoleController/ConsoleController.cpp b/src/Controllers/ConsoleController/ConsoleController.cpp index 1bc9b84..57f626f 100644 --- a/src/Controllers/ConsoleController/ConsoleController.cpp +++ b/src/Controllers/ConsoleController/ConsoleController.cpp @@ -70,6 +70,9 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() //Initialise keyPress kbdh::Direction keyPress; + //White space to remove arrows print by the terminal + std::string spaces=" "; + //Wait for keypress while(1){ if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) @@ -78,7 +81,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() while(sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) { //Wait for release and try to remove arrow printed characters - std::cout << "\r" << " "; + std::cout << "\r" << spaces; } break; } @@ -88,7 +91,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() while(sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) { //Wait for release and try to remove arrow printed characters - std::cout << "\r" << " "; + std::cout << "\r" << spaces; } break; } @@ -98,7 +101,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() while(sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) { //Wait for release and try to remove arrow printed characters - std::cout << "\r" << " "; + std::cout << "\r" << spaces; } break; } @@ -108,7 +111,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() while(sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) { //Wait for release and try to remove arrow printed characters - std::cout << "\r" << " "; + std::cout << "\r" << spaces; } break; }