diff options
author | Paul Gilbert | 2016-03-18 21:34:04 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-18 21:34:04 -0400 |
commit | 9565fbaeac8f48ea0090ebbd751a18eacc6d1230 (patch) | |
tree | 171dfb6d26b10897f93062d5871364b83929c4a5 /engines/titanic/input_translator.cpp | |
parent | 61947ef56b77ab4778adafde93388fb526911eb7 (diff) | |
download | scummvm-rg350-9565fbaeac8f48ea0090ebbd751a18eacc6d1230.tar.gz scummvm-rg350-9565fbaeac8f48ea0090ebbd751a18eacc6d1230.tar.bz2 scummvm-rg350-9565fbaeac8f48ea0090ebbd751a18eacc6d1230.zip |
TITANIC: Implement input translator event methods
Diffstat (limited to 'engines/titanic/input_translator.cpp')
-rw-r--r-- | engines/titanic/input_translator.cpp | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp index b2ee6eb819..8b12646474 100644 --- a/engines/titanic/input_translator.cpp +++ b/engines/titanic/input_translator.cpp @@ -22,6 +22,8 @@ #include "titanic/input_handler.h" #include "titanic/input_translator.h" +#include "titanic/events.h" +#include "titanic/messages/mouse_messages.h" namespace Titanic { @@ -30,4 +32,57 @@ CInputTranslator::CInputTranslator(CInputHandler *inputHandler) : inputHandler->setTranslator(this); } -} // End of namespace Titanic z +int CInputTranslator::getButtons(int special) const { + int buttons = 0; + if (special & MK_LBUTTON) + buttons |= MB_LEFT; + if (special & MK_MBUTTON) + buttons |= MB_MIDDLE; + if (special & MK_RBUTTON) + buttons |= MB_RIGHT; + + return buttons; +} + +void CInputTranslator::mouseMove(int special, const Common::Point &pt) { + CMouseMoveMsg msg(pt, getButtons(special)); + _inputHandler->handleMessage(msg); +} + +void CInputTranslator::leftButtonDown(int special, const Common::Point &pt) { + +} + +void CInputTranslator::leftButtonUp(int special, const Common::Point &pt) { + +} + +void CInputTranslator::leftButtonDoubleClick(int special, const Common::Point &pt) { + +} + +void CInputTranslator::middleButtonDown(int special, const Common::Point &pt) { + +} + +void CInputTranslator::middleButtonUp(int special, const Common::Point &pt) { + +} + +void CInputTranslator::middleButtonDoubleClick(int special, const Common::Point &pt) { + +} + +void CInputTranslator::rightButtonDown(int special, const Common::Point &pt) { + +} + +void CInputTranslator::rightButtonUp(int special, const Common::Point &pt) { + +} + +void CInputTranslator::rightButtonDoubleClick(int special, const Common::Point &pt) { + +} + +} // End of namespace Titanic |