From 9565fbaeac8f48ea0090ebbd751a18eacc6d1230 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Mar 2016 21:34:04 -0400 Subject: TITANIC: Implement input translator event methods --- engines/titanic/input_translator.cpp | 57 +++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'engines/titanic/input_translator.cpp') 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 -- cgit v1.2.3