aboutsummaryrefslogtreecommitdiff
path: root/backends/wince/CEkeys
diff options
context:
space:
mode:
Diffstat (limited to 'backends/wince/CEkeys')
-rw-r--r--backends/wince/CEkeys/EventsBuffer.cpp14
-rw-r--r--backends/wince/CEkeys/EventsBuffer.h4
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);
};
}