Add fixed white space
This commit is contained in:
parent
4cc6c6596b
commit
bf5ec3cfe5
1 changed files with 7 additions and 4 deletions
|
@ -70,6 +70,9 @@ kbdh::Direction ConsoleController::waitArrowKeyPress()
|
||||||
//Initialise keyPress
|
//Initialise keyPress
|
||||||
kbdh::Direction keyPress;
|
kbdh::Direction keyPress;
|
||||||
|
|
||||||
|
//White space to remove arrows print by the terminal
|
||||||
|
std::string spaces=" ";
|
||||||
|
|
||||||
//Wait for keypress
|
//Wait for keypress
|
||||||
while(1){
|
while(1){
|
||||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
||||||
|
@ -78,7 +81,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress()
|
||||||
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
|
||||||
{
|
{
|
||||||
//Wait for release and try to remove arrow printed characters
|
//Wait for release and try to remove arrow printed characters
|
||||||
std::cout << "\r" << " ";
|
std::cout << "\r" << spaces;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +91,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress()
|
||||||
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
|
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
|
||||||
{
|
{
|
||||||
//Wait for release and try to remove arrow printed characters
|
//Wait for release and try to remove arrow printed characters
|
||||||
std::cout << "\r" << " ";
|
std::cout << "\r" << spaces;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +101,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress()
|
||||||
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
|
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
|
||||||
{
|
{
|
||||||
//Wait for release and try to remove arrow printed characters
|
//Wait for release and try to remove arrow printed characters
|
||||||
std::cout << "\r" << " ";
|
std::cout << "\r" << spaces;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +111,7 @@ kbdh::Direction ConsoleController::waitArrowKeyPress()
|
||||||
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
|
while(sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
|
||||||
{
|
{
|
||||||
//Wait for release and try to remove arrow printed characters
|
//Wait for release and try to remove arrow printed characters
|
||||||
std::cout << "\r" << " ";
|
std::cout << "\r" << spaces;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue