mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 06:41:05 +08:00
[Android] Added missing sensor event generation
This commit is contained in:
parent
86983acaa4
commit
5b559f1c08
@ -176,6 +176,27 @@ int SensorImpl::processSensorEvents(int fd, int events, void* data)
|
|||||||
data.y = event.magnetic.y;
|
data.y = event.magnetic.y;
|
||||||
data.z = event.magnetic.z;
|
data.z = event.magnetic.z;
|
||||||
break;
|
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
|
// An unknown sensor event has been detected, we don't know how to process it
|
||||||
|
Loading…
Reference in New Issue
Block a user