diff options
author | Filippos Karapetis | 2015-12-24 18:30:41 +0200 |
---|---|---|
committer | Filippos Karapetis | 2015-12-24 18:30:41 +0200 |
commit | c0f3131fbe5b0e297c49791a19274638e2ca8d76 (patch) | |
tree | 477bf3d8f3b7bca9723fac24c0acd4e7c14369ce /engines/lab | |
parent | b2fad340b5f6cf2c54cb64241003867f5a5a893c (diff) | |
download | scummvm-rg350-c0f3131fbe5b0e297c49791a19274638e2ca8d76.tar.gz scummvm-rg350-c0f3131fbe5b0e297c49791a19274638e2ca8d76.tar.bz2 scummvm-rg350-c0f3131fbe5b0e297c49791a19274638e2ca8d76.zip |
LAB: Reorganize the code a bit in getMsg()
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/interface.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index 6f0156234a..4d00d7af20 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -135,18 +135,20 @@ IntuiMessage *EventManager::getMsg() { _leftClick = _rightClick = false; return &message; } else if (_keyPressed.keycode != Common::KEYCODE_INVALID) { - message._code = _keyPressed.keycode; - _keyPressed.keycode = Common::KEYCODE_INVALID; - - Button *curButton = checkNumButtonHit(_screenButtonList, message._code); + Button *curButton = checkNumButtonHit(_screenButtonList, _keyPressed.keycode); if (curButton) { message._msgClass = kMessageButtonUp; message._code = curButton->_buttonId; - } else + } else { message._msgClass = kMessageRawKey; + message._code = _keyPressed.keycode; + } message._qualifier = _keyPressed.flags; + + _keyPressed.keycode = Common::KEYCODE_INVALID; + return &message; } else return nullptr; |