Hey guys, wondering if you guys could help me test something real quick. With the following code whenever I issue a keyboard keyPress, the key fires off both a key press and a key release:
#include <SFML/Window.hpp>
#include <iostream>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");
window.setKeyRepeatEnabled(false);
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
switch(event.type)
{
case sf::Event::KeyPressed:
{
if(event.key.code == sf::Keyboard::W)
{
std::cout << "\n\nKeyPressed";
}
}
case sf::Event::KeyReleased:
{
if(event.key.code == sf::Keyboard::W)
{
//window.close();
//break;
std::cout << "\nKeyReleased";
}
}
}
}
}
return 0;
}
You can view my test results here:
Just the output from the code above, as you can see, every keypress fires off a KeyPressed and a keyReleased
This is keyboard only as joystick works fine.
currently on commit: d73418261b5aed44861ea66faaa4ef3d2589fc6a (exploiters nightly, visual studio 2012 32 bit June 20th 2014)
Any info would be greatly appreciated. Thanks!