title: SFML - Creating a cursor and printing input?
body: <p>So I've downloaded SFML and so far love it. I've run into a roadblock and am trying to figure out how to implement a blinking cursor into the code below. I also need to figure out how to print a single char (when the user presses a key on the keyboard) onto the window. Here's some code I've used ever since I've downloaded SFML 2.0:</p>
  
  <pre><code>#include &lt;SFML/Graphics.hpp&gt;
  #include &lt;SFML/System.hpp&gt;
  #include &lt;SFML/Window.hpp&gt;
  #include &lt;iostream&gt;
  
  int main() {
      sf::RenderWindow wnd(sf::VideoMode(650, 300), "SFML Console");
      sf::Vector2u myVector(650, 300);
      wnd.setSize(myVector);
  
      sf::Font myFont;
      myFont.loadFromFile("theFont.ttf");
  
      sf::Color myClr;
      myClr.r = 0;
      myClr.g = 203;
      myClr.b = 0;
  
      sf::String myStr = "Hello world!";
      std::char myCursor = '_';
  
      sf::Text myTxt;
      myTxt.setColor(myClr);
      myTxt.setString(myStr);
      myTxt.setFont(myFont);
      myTxt.setCharacterSize(12);
      myTxt.setStyle(sf::Text::Regular);
      myTxt.setPosition(0, 0);
  
      std::int myCounter = 0;
  
      while(wnd.isOpen()) {
          sf::Event myEvent;
  
          while (wnd.pollEvent(myEvent)) {
              if (myEvent.type == sf::Event::Closed) {
                  wnd.close();
              }
  
              if (myEvent.type == sf::Event::KeyPressed) {
                  if (myEvent.key.code == sf::Keyboard::Escape) {
                      wnd.close();
                  }
              }
  
              wnd.clear();
              wnd.draw(myTxt);
  
              myCounter++;
              std::if (myCounter &gt;= 1000) {
                  myCounter = 0;
              }
  
              std::if (myCounter &lt; 1000) {
                  myTxt.setString("Hello world!_");
              }
  
              wnd.display();
          }
      }
  }
  </code></pre>