Hello everyone, I'm new to this forum. Anyhow, I recently upgraded to the newest version of SFML 2.0 because I wanted to build SFML from source (I needed to modify the source so that I could implement point looping for music). When I upgraded to this newest version, I soon realized that the keyreleased events did not work 100% of the time. This proved to be quite troublesome for my tile-based game which relied on keyreleased events to stop my sprite from moving.
It seems that I am not the only one who has come across this issue:
http://en.sfml-dev.org/forums/index.php?topic=11482.0(Look at the 6th post of the thread to see minimal code of this problem)
Coincidentally enough, like the author of the above thread, I am also using Ubuntu 12.04. I have not verified the existence of this bug on other operating systems.
I did some investigating: It appears that the root of this problem lies in processEvent method located in the file: Window/Linux/WindowImplX11.cpp
Furthermore, within the processEvent method, the bug seems to arise in the implementation of detecting repeated events. I did a search, and found that the detecting repeated events algorithm was modified a few months back because of a problem with events firing multiple times:
http://en.sfml-dev.org/forums/index.php?topic=10156.0Seems like when one bug is fixed, another one arises, eh? The fix to prevent KeyPressed and KeyReleased events from firing multiple times seems to have introduced the problem of the KeyReleased event not always being triggered.
When I modified the file to revert back to the older version of the algorithm, and then built the modified version of SFML 2.0, everything is working... well, at least in regards to the triggering of the KeyReleased Event. Hopefully, this bug will be resolved in future releases of SFML.