diff options
Diffstat (limited to 'backends/platform/wince/CEkeys')
-rw-r--r-- | backends/platform/wince/CEkeys/EventsBuffer.cpp | 98 | ||||
-rw-r--r-- | backends/platform/wince/CEkeys/EventsBuffer.h | 16 |
2 files changed, 57 insertions, 57 deletions
diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index c9f4af2304..beea272d2b 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -29,55 +29,55 @@ namespace CEKEYS { - bool EventsBuffer::simulateKey(GUI::Key *key, bool pushed) { - SDL_Event ev = {0}; - - if (!key->keycode()) - key->setKey(key->ascii(), key->ascii()); - else if (!key->ascii()) - key->setKey(key->keycode()); - - ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); - ev.key.keysym.unicode = (SDLMod)key->flags(); // HACK: put the flags into the unused unicode field - ev.key.keysym.sym = (SDLKey)key->keycode(); - ev.key.keysym.mod = KMOD_RESERVED; - return (SDL_PushEvent(&ev) == 0); - } - - bool EventsBuffer::simulateMouseMove(int x, int y) { - SDL_Event ev = {0}; - - ev.type = SDL_MOUSEMOTION; - ev.motion.x = x; - ev.motion.y = y; - return (SDL_PushEvent(&ev) == 0); - } - - 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; - ev.button.y = y; - return (SDL_PushEvent(&ev) == 0); - } - - 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; - ev.button.y = y; - return (SDL_PushEvent(&ev) == 0); - } +bool EventsBuffer::simulateKey(GUI::Key *key, bool pushed) { + SDL_Event ev = {0}; + + if (!key->keycode()) + key->setKey(key->ascii(), key->ascii()); + else if (!key->ascii()) + key->setKey(key->keycode()); + + ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); + ev.key.keysym.unicode = (SDLMod)key->flags(); // HACK: put the flags into the unused unicode field + ev.key.keysym.sym = (SDLKey)key->keycode(); + ev.key.keysym.mod = KMOD_RESERVED; + return (SDL_PushEvent(&ev) == 0); +} + +bool EventsBuffer::simulateMouseMove(int x, int y) { + SDL_Event ev = {0}; + + ev.type = SDL_MOUSEMOTION; + ev.motion.x = x; + ev.motion.y = y; + return (SDL_PushEvent(&ev) == 0); +} + +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; + ev.button.y = y; + return (SDL_PushEvent(&ev) == 0); +} + +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; + ev.button.y = y; + return (SDL_PushEvent(&ev) == 0); +} } diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h index 22590db03c..9b766c6ca9 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.h +++ b/backends/platform/wince/CEkeys/EventsBuffer.h @@ -34,14 +34,14 @@ namespace CEKEYS { - class EventsBuffer { - public: - static bool simulateKey(GUI::Key *key, bool pushed); - static bool simulateMouseMove(int x, int y); - static bool simulateMouseLeftClick(int x, int y, bool pushed); - static bool simulateMouseRightClick(int x, int y, bool pushed); - - }; +class EventsBuffer { +public: + static bool simulateKey(GUI::Key *key, bool pushed); + static bool simulateMouseMove(int x, int y); + static bool simulateMouseLeftClick(int x, int y, bool pushed); + static bool simulateMouseRightClick(int x, int y, bool pushed); + +}; } #endif |