Skip to content

Commit

Permalink
LAB: Reorganize the code a bit in getMsg()
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Dec 24, 2015
1 parent b2fad34 commit c0f3131
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions engines/lab/interface.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit c0f3131

Please sign in to comment.