summaryrefslogtreecommitdiff
path: root/external/plyer/platforms/ios/gyroscope.py
diff options
context:
space:
mode:
authorLivio Recchia <recchialivio@libero.it>2020-02-10 23:06:34 +0100
committerLivio Recchia <recchialivio@libero.it>2020-02-10 23:06:34 +0100
commit9a13903a2f7d3a65fdf15a65fb59cccd622e2066 (patch)
tree9403b7dff39eb5e5d7fa0f79efb69b496add4c4b /external/plyer/platforms/ios/gyroscope.py
parent11cc316b74d5f3f283413a33e7693b314741aa4a (diff)
downloadmanachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.gz
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.bz2
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.tar.xz
manachat-9a13903a2f7d3a65fdf15a65fb59cccd622e2066.zip
Initial commit
Diffstat (limited to 'external/plyer/platforms/ios/gyroscope.py')
-rw-r--r--external/plyer/platforms/ios/gyroscope.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/external/plyer/platforms/ios/gyroscope.py b/external/plyer/platforms/ios/gyroscope.py
new file mode 100644
index 0000000..e8b93cf
--- /dev/null
+++ b/external/plyer/platforms/ios/gyroscope.py
@@ -0,0 +1,31 @@
+'''
+iOS Gyroscope
+---------------------
+'''
+
+from plyer.facades import Gyroscope
+from pyobjus import autoclass
+
+
+class IosGyroscope(Gyroscope):
+
+ def __init__(self):
+ super(IosGyroscope, self).__init__()
+ self.bridge = autoclass('bridge').alloc().init()
+ self.bridge.motionManager.setGyroscopeUpdateInterval_(0.1)
+
+ def _enable(self):
+ self.bridge.startGyroscope()
+
+ def _disable(self):
+ self.bridge.stopGyroscope()
+
+ def _get_orientation(self):
+ return (
+ self.bridge.gy_x,
+ self.bridge.gy_y,
+ self.bridge.gy_z)
+
+
+def instance():
+ return IosGyroscope()