Ok, ignore my previous post, I'll try a more aggressive solution: stealing the code from SDL ;D
Since their code is more simple, more compact and obviously works perfectly (and they already got it from another project), let's just use it.
Could you try to replace the ugly hack which detects repeated keys in SFML with this one?
if (windowEvent.type == KeyRelease)
{
// Check if there's a matching KeyPress event in the queue
XEvent nextEvent;
if (XPending(m_display))
{
// Grab it but don't remove it from the queue, it still needs to be processed :)
XPeekEvent(m_display, &nextEvent);
if (nextEvent.type == KeyPress)
{
// Check if it is a duplicated event (same timestamp as the KeyRelease event)
if ((nextEvent.xkey.keycode == windowEvent.xkey.keycode) &&
(nextEvent.xkey.time - windowEvent.xkey.time < 2))
{
// If we don't want repeated events, remove the next KeyPress from the queue
if (!m_keyRepeat)
XNextEvent(m_display, &nextEvent);
// This KeyRelease is a repeated event and we don't want it
return false;
}
}
}
}