lib/android: intro motion down_time
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 30 Jan 2015 14:57:46 +0000 (09:57 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 21 May 2016 19:10:08 +0000 (15:10 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/android/input_events.nit

index 8aea378..5ee9d87 100644 (file)
@@ -70,6 +70,8 @@ private extern class NativeAndroidMotionEvent `{AInputEvent *`}
        `}
 
        fun action: AMotionEventAction `{ return AMotionEvent_getAction(self); `}
+
+       fun native_down_time: Int `{ return AMotionEvent_getDownTime(self); `}
 end
 
 private extern class AMotionEventAction `{ int32_t `}
@@ -149,6 +151,11 @@ class AndroidMotionEvent
                        return null
                end
        end
+
+       # Time when the user originally pressed down to start a stream of position events
+       #
+       # The return value is in the `java.lang.System.nanoTime()` time base.
+       fun down_time: Int do return native.native_down_time
 end
 
 # A pointer event