From 2ef8fa338c2d035d030b9d29c4ad18bf571c3102 Mon Sep 17 00:00:00 2001 From: "jean.chalard" Date: Sat, 27 Feb 2010 10:57:32 +0000 Subject: [PATCH] J : * Fix issue 340 for good. * On X systems this still depends on a working X detectable repeat, which is not the case in stable releases of some popular linux distributons at this time. This is expected to be fixed soon. I haven't chosen yet whether I wait for the fix on X side or if I work around the bug. --- JGE/src/JGE.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/JGE/src/JGE.cpp b/JGE/src/JGE.cpp index 16af06b4c..9970a2515 100644 --- a/JGE/src/JGE.cpp +++ b/JGE/src/JGE.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include "../include/JGE.h" @@ -128,16 +129,20 @@ void JGE::HoldKey_NoRepeat(const JButton sym) } void JGE::ReleaseKey(const LocalKeySym sym) { + set s; const pair rng = keyBinds.equal_range(sym); for (keycodes_it it = rng.first; it != rng.second; ++it) - holds.erase(it->second); + { + s.insert(it->second); + holds.erase(it->second); + } queue< pair, bool> > r; while (!keyBuffer.empty()) { pair, bool> q = keyBuffer.front(); keyBuffer.pop(); - if ((!q.second)) r.push(q); + if ((!q.second) || (s.end() == s.find(q.first.second))) r.push(q); } keyBuffer = r; }