Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Events when the window is not focused  (Read 1890 times)

0 Members and 1 Guest are viewing this topic.

Yoninde

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Events when the window is not focused
« on: April 17, 2015, 05:09:33 pm »
Hello. My question is, how make an event - event->type == sf::Event::TextEntered, when window is not focused? If I can't do this, can I use sf::Keyboard::isKeyPressed like a TextEntered, don't write like:
if( sf::Keyboard::isKeyPressed( sf::Keyboard::W ) ) text += "W";
but like in TextEntered,
text += static_cast<char>( event->text.unicode );

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Events when the window is not focused
« Reply #1 on: April 17, 2015, 05:16:14 pm »
No, you can't. But there's hardly any reason to process text events in a non-focused window. And SFML is not the right tool for writing a key logger.
Laurent Gomila - SFML developer

 

anything