diff options
author | David Corrales | 2007-06-23 18:51:33 +0000 |
---|---|---|
committer | David Corrales | 2007-06-23 18:51:33 +0000 |
commit | cacd7a28fd51d960947de88abbf30c487e66529d (patch) | |
tree | f3baa59853bfb307e452b86b9d93c4737b1fa6ab /backends/platform/wince/CEgui/PanelKeyboard.cpp | |
parent | 0ac96302fe9c04df79cb01a77d19535b45fe2db0 (diff) | |
parent | 90c2210dae8c91fa8babc6b05564e15c9d445d18 (diff) | |
download | scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.gz scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.bz2 scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.zip |
Merged the FSNode branch with trunk r27031:27680
svn-id: r27681
Diffstat (limited to 'backends/platform/wince/CEgui/PanelKeyboard.cpp')
-rw-r--r-- | backends/platform/wince/CEgui/PanelKeyboard.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp index 8a17a4c1c4..79b833f84b 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp @@ -35,6 +35,8 @@ namespace CEGUI { PanelKeyboard::PanelKeyboard(WORD reference) : Toolbar() { setBackground(reference); + _state = false; + _lastKey.setKey(0); } @@ -42,6 +44,7 @@ namespace CEGUI { } bool PanelKeyboard::action(int x, int y, bool pushed) { + Key key; if (checkInside(x, y)) { int keyAscii = 0; @@ -62,19 +65,35 @@ namespace CEGUI { keyAscii = VK_BACK; keyCode = keyAscii; } else { // Enter - keyAscii = 13; keyCode = 10; + keyAscii = 13; keyCode = 13; } } if (keyAscii != 0) { - _key.setAscii(keyAscii); - _key.setKeycode(tolower(keyCode)); - return EventsBuffer::simulateKey(&_key, pushed); + if (_state && pushed && keyCode != _lastKey.keycode()) // if cursor is still down and off the current key + return false; + else if (_state && !pushed && keyCode != _lastKey.keycode()) { // cursor is up but off the current key + keyAscii = _lastKey.ascii(); + keyCode = _lastKey.keycode(); + } + _state = pushed; + _lastKey.setKey(keyAscii, tolower(keyCode)); + + key.setKey(keyAscii, tolower(keyCode)); + return EventsBuffer::simulateKey(&key, pushed); } - else + else if (_state && !pushed) { // cursor is in some forbidden region and is up + _state = false; + key = _lastKey; + return EventsBuffer::simulateKey(&key, false); + } else return false; } - else + else if (_state && !pushed) { // cursor left the keyboard area and is up + _state = false; + key = _lastKey; + return EventsBuffer::simulateKey(&key, false); + } else return false; } } |