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

Author Topic: Key pressur don't return anithing 2.1  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

Aridjar

  • Newbie
  • *
  • Posts: 1
    • View Profile
Key pressur don't return anithing 2.1
« on: July 22, 2014, 05:06:16 pm »
Hey.

It's my first topic, so you'll probably ask me more details, but i can't put all the code cause it's on an other computer.

So, here the thing : I need tu use the Return and Escape key of my keyboard. But, with the following code :

while (window.isOpen())
{
while(window.pollEvent(event))
if (event.type == sf::Event::KeyPressed)
std::cout << _event.key.code << std::endl;
}
 

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Key pressur don't return anithing 2.1
« Reply #1 on: July 22, 2014, 05:30:59 pm »
It's my first topic, so you'll probably ask me more details
You guessed correctly :P
You should read this thread. Please take the time and read it carefully, it will save you and us time with useless questions :)

but i can't put all the code cause it's on an other computer.
You're not supposed to post all the code, a minimal complete example as explained in the link is ideal.

Most importantly, describe the problem.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Key pressur don't return anithing 2.1
« Reply #2 on: July 22, 2014, 05:42:16 pm »
you seem to be using two different sf::Event objects, "event" and "_event".
if changing that doesn't fix the problem, then i have no idea. even your topic doesn't seems to be finished :P
Visit my game site (and hopefully help funding it? )
Website | IndieDB

 

anything