From a15885656db00a5013c01381f4f61cc8a442977b Mon Sep 17 00:00:00 2001 From: Kostas Nakos Date: Sat, 21 Oct 2006 11:12:46 +0000 Subject: Fix multiple simulated mouse key events bug (sync). svn-id: r24403 --- backends/platform/wince/CEkeys/EventsBuffer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backends') diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index f89b851280..ca8c2eee58 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -53,7 +53,10 @@ namespace CEKEYS { bool EventsBuffer::simulateMouseLeftClick(int x, int y, bool pushed) { SDL_Event ev = {0}; + static bool state = false; + if (pushed == state) return 0; + state = pushed; ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); ev.button.button = SDL_BUTTON_LEFT; ev.button.x = x; @@ -63,7 +66,10 @@ namespace CEKEYS { bool EventsBuffer::simulateMouseRightClick(int x, int y, bool pushed) { SDL_Event ev = {0}; + static bool state = false; + if (pushed == state) return 0; + state = pushed; ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); ev.button.button = SDL_BUTTON_RIGHT; ev.button.x = x; -- cgit v1.2.3