diff options
Diffstat (limited to 'backends/wince/CEkeys')
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.cpp | 8 | ||||
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/backends/wince/CEkeys/EventsBuffer.cpp b/backends/wince/CEkeys/EventsBuffer.cpp index 918da88e56..70da6cd435 100644 --- a/backends/wince/CEkeys/EventsBuffer.cpp +++ b/backends/wince/CEkeys/EventsBuffer.cpp @@ -24,7 +24,7 @@ namespace CEKEYS { - bool EventsBuffer::simulateKey(Key *key) { + bool EventsBuffer::simulateKey(Key *key, bool pushed) { SDL_Event ev = {0}; if (!key->keycode()) @@ -33,13 +33,11 @@ namespace CEKEYS { if (!key->ascii()) key->setAscii(key->keycode()); - ev.type = SDL_KEYDOWN; + ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); ev.key.keysym.mod = (SDLMod)key->flags(); ev.key.keysym.sym = (SDLKey)key->keycode(); ev.key.keysym.unicode = key->keycode(); - if (SDL_PushEvent(&ev)) - return false; - ev.type = SDL_KEYUP; + ev.key.keysym.mod = KMOD_RESERVED; return (SDL_PushEvent(&ev) == 0); } diff --git a/backends/wince/CEkeys/EventsBuffer.h b/backends/wince/CEkeys/EventsBuffer.h index b258a1c00b..938e8cc886 100644 --- a/backends/wince/CEkeys/EventsBuffer.h +++ b/backends/wince/CEkeys/EventsBuffer.h @@ -35,7 +35,7 @@ namespace CEKEYS { class EventsBuffer { public: - static bool simulateKey(Key *key); + static bool simulateKey(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); |