src/SimulatorSocketServer.cpp
branchv_0
changeset 3 42d64bd73232
parent 2 a27850958a67
child 5 980a27d138f7
--- a/src/SimulatorSocketServer.cpp	Thu Mar 14 16:11:08 2019 +0100
+++ b/src/SimulatorSocketServer.cpp	Thu Mar 14 16:46:16 2019 +0100
@@ -16,7 +16,11 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <iostream>
+
 #include "SimulatorSocketServer.h"
+#include "ButtonEvent.h"
+#include "MotionEvent.h"
 
 SimulatorSocketServer::SimulatorSocketServer() {
 }
@@ -27,3 +31,20 @@
 SimulatorSocketServer::~SimulatorSocketServer() {
 }
 
+void SimulatorSocketServer::publishButtonEvent(const ButtonEvent e) {
+	std::wcout << L"buttonEvent(" << e.number << L", " << (e.pressed ? L"pressed" : L"released") << L")" << std::endl;
+}
+
+void SimulatorSocketServer::publishMotionEvent(const MotionEvent e) {
+	std::wcout << L"motionEvent( m = ["
+			<< e.x << L", "
+			<< e.y << L", "
+			<< e.z << L"], "
+			<< L"r = ["
+			<< e.rx << L", "
+			<< e.ry << L", "
+			<< e.rz << L"], "
+			<< L"period = " << e.period
+			<< L")" << std::endl;
+
+}