diff options
author | Nicolas Bacca | 2004-01-26 20:32:29 +0000 |
---|---|---|
committer | Nicolas Bacca | 2004-01-26 20:32:29 +0000 |
commit | 511e8ded4ed26cea2011393c7bc0ce1841f79401 (patch) | |
tree | a4bb3d5e9f19d7586f5021f5697b3b68420d0611 /backends | |
parent | a5aba18abf750ce81724cba41cc2c7d2e544a1d3 (diff) | |
download | scummvm-rg350-511e8ded4ed26cea2011393c7bc0ce1841f79401.tar.gz scummvm-rg350-511e8ded4ed26cea2011393c7bc0ce1841f79401.tar.bz2 scummvm-rg350-511e8ded4ed26cea2011393c7bc0ce1841f79401.zip |
Fix ItemAction
svn-id: r12627
Diffstat (limited to 'backends')
-rw-r--r-- | backends/wince/CEActions.cpp | 2 | ||||
-rw-r--r-- | backends/wince/CEgui/ItemAction.cpp | 2 | ||||
-rw-r--r-- | backends/wince/CEkeys/KeysBuffer.cpp | 13 | ||||
-rw-r--r-- | backends/wince/CEkeys/KeysBuffer.h | 1 |
4 files changed, 16 insertions, 2 deletions
diff --git a/backends/wince/CEActions.cpp b/backends/wince/CEActions.cpp index 65ac639e51..ed5b1b47c2 100644 --- a/backends/wince/CEActions.cpp +++ b/backends/wince/CEActions.cpp @@ -129,7 +129,7 @@ bool CEActions::perform(ActionType action) { case ACTION_PAUSE: case ACTION_SAVE: case ACTION_SKIP: - KeysBuffer::Instance()->add(&_key_action[action]); + KeysBuffer::Instance()->simulate(&_key_action[action]); return true; case ACTION_KEYBOARD: _mainSystem->swap_panel(); diff --git a/backends/wince/CEgui/ItemAction.cpp b/backends/wince/CEgui/ItemAction.cpp index b7a7ab119d..c0cecff004 100644 --- a/backends/wince/CEgui/ItemAction.cpp +++ b/backends/wince/CEgui/ItemAction.cpp @@ -37,7 +37,7 @@ namespace CEGUI { bool ItemAction::action(int x, int y, bool pushed) { - if (checkInside(x, y) && _visible) { + if (checkInside(x, y) && _visible && pushed) { CEActions::Instance()->perform(_action); return true; } diff --git a/backends/wince/CEkeys/KeysBuffer.cpp b/backends/wince/CEkeys/KeysBuffer.cpp index 2a15d36356..df1326094a 100644 --- a/backends/wince/CEkeys/KeysBuffer.cpp +++ b/backends/wince/CEkeys/KeysBuffer.cpp @@ -38,6 +38,19 @@ namespace CEKEYS { return true; } + bool KeysBuffer::simulate(const Key *key) { + if (_currentAdd == _capacity - 2) + return false; + + _currentGet = _currentAdd; + _buffer[_currentAdd] = *key; + _buffer[_currentAdd++].setPushed(true); + _buffer[_currentAdd] = *key; + _buffer[_currentAdd++].setPushed(false); + + return true; + } + KeysBuffer* KeysBuffer::Instance(int capacity) { if (!_instance) _instance = new KeysBuffer(capacity); diff --git a/backends/wince/CEkeys/KeysBuffer.h b/backends/wince/CEkeys/KeysBuffer.h index 5f187c8fc0..b8c56109d0 100644 --- a/backends/wince/CEkeys/KeysBuffer.h +++ b/backends/wince/CEkeys/KeysBuffer.h @@ -35,6 +35,7 @@ namespace CEKEYS { public: static KeysBuffer* Instance(int capacity = 5); bool add(const Key *key); + bool simulate(const Key *key); Key* get(); ~KeysBuffer(); private: |