Can anyone explain why the code below output something like this, when pressing right and left arrow key?
Output:
^[[DLeft
^[[C^[[C^[[CRight
^[[D^[[DLeft
^[[D^[[DLeft
^[[C^[[C^[[CRight
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
int main(int argc, char** argv)
{
while(1)
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
cout << "Left" << endl;
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
{
cout << "Right" << endl;
}
sf::sleep(sf::milliseconds(1000));
}
}