From 5b559f1c0898dcaa75eaf1b996271621d2641fd7 Mon Sep 17 00:00:00 2001 From: Mario Liebisch Date: Sun, 15 Jun 2014 15:04:24 +0200 Subject: [PATCH] [Android] Added missing sensor event generation --- src/SFML/Window/Android/SensorImpl.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/SFML/Window/Android/SensorImpl.cpp b/src/SFML/Window/Android/SensorImpl.cpp index 998825bcd..6492fff76 100644 --- a/src/SFML/Window/Android/SensorImpl.cpp +++ b/src/SFML/Window/Android/SensorImpl.cpp @@ -176,6 +176,27 @@ int SensorImpl::processSensorEvents(int fd, int events, void* data) data.y = event.magnetic.y; data.z = event.magnetic.z; break; + + case ASENSOR_TYPE_GRAVITY: + type = Sensor::Gravity; + data.x = event.vector.x; + data.y = event.vector.y; + data.z = event.vector.z; + break; + + case ASENSOR_TYPE_LINEAR_ACCELERATION: + type = Sensor::UserAcceleration; + data.x = event.acceleration.x; + data.y = event.acceleration.y; + data.z = event.acceleration.z; + break; + + case ASENSOR_TYPE_ORIENTATION: + type = Sensor::Orientation; + data.x = event.vector.x; + data.y = event.vector.y; + data.z = event.vector.z; + break; } // An unknown sensor event has been detected, we don't know how to process it