diff options
author | Nicolas Bacca | 2004-12-21 00:31:58 +0000 |
---|---|---|
committer | Nicolas Bacca | 2004-12-21 00:31:58 +0000 |
commit | 22aac69fe5c3ef2f719c5348ef85510513191eea (patch) | |
tree | 120065edd27e5acbd6940c1361c413e48ece95b5 /backends/wince/CEkeys | |
parent | 1bd0c66715f4229059f2eb586455e68bff0b3128 (diff) | |
download | scummvm-rg350-22aac69fe5c3ef2f719c5348ef85510513191eea.tar.gz scummvm-rg350-22aac69fe5c3ef2f719c5348ef85510513191eea.tar.bz2 scummvm-rg350-22aac69fe5c3ef2f719c5348ef85510513191eea.zip |
Cleanup mouseclick emulation (and make the new about dialog happy)
svn-id: r16222
Diffstat (limited to 'backends/wince/CEkeys')
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.cpp | 14 | ||||
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.h | 4 |
2 files changed, 6 insertions, 12 deletions
diff --git a/backends/wince/CEkeys/EventsBuffer.cpp b/backends/wince/CEkeys/EventsBuffer.cpp index 37b58f640f..97ec7c2004 100644 --- a/backends/wince/CEkeys/EventsBuffer.cpp +++ b/backends/wince/CEkeys/EventsBuffer.cpp @@ -52,29 +52,23 @@ namespace CEKEYS { return (SDL_PushEvent(&ev) == 0); } - bool EventsBuffer::simulateMouseLeftClick(int x, int y) { + bool EventsBuffer::simulateMouseLeftClick(int x, int y, bool pushed) { SDL_Event ev = {0}; - ev.type = SDL_MOUSEBUTTONDOWN; + ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); ev.button.button = SDL_BUTTON_LEFT; ev.button.x = x; ev.button.y = y; - if (SDL_PushEvent(&ev)) - return false; - ev.type = SDL_MOUSEBUTTONUP; return (SDL_PushEvent(&ev) == 0); } - bool EventsBuffer::simulateMouseRightClick(int x, int y) { + bool EventsBuffer::simulateMouseRightClick(int x, int y, bool pushed) { SDL_Event ev = {0}; - ev.type = SDL_MOUSEBUTTONDOWN; + ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); ev.button.button = SDL_BUTTON_RIGHT; ev.button.x = x; ev.button.y = y; - if (SDL_PushEvent(&ev)) - return false; - ev.type = SDL_MOUSEBUTTONUP; return (SDL_PushEvent(&ev) == 0); } } diff --git a/backends/wince/CEkeys/EventsBuffer.h b/backends/wince/CEkeys/EventsBuffer.h index 12dacee94d..200478026d 100644 --- a/backends/wince/CEkeys/EventsBuffer.h +++ b/backends/wince/CEkeys/EventsBuffer.h @@ -37,8 +37,8 @@ namespace CEKEYS { public: static bool simulateKey(Key *key); static bool simulateMouseMove(int x, int y); - static bool simulateMouseLeftClick(int x, int y); - static bool simulateMouseRightClick(int x, int y); + static bool simulateMouseLeftClick(int x, int y, bool pushed); + static bool simulateMouseRightClick(int x, int y, bool pushed); }; } |