mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 00:42:38 +00:00
add input timestamp api
This commit is contained in:
3 files changed
+58
-31
No files matched your search
@@ -515,12 +515,17 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
}
|
||||
|
||||
override fun onCapabilityAdded(capability: String): Boolean {
|
||||
if (capability == GeodeUtils.CAPABILITY_EXTENDED_INPUT) {
|
||||
mGLSurfaceView?.useKeyboardEvents = true
|
||||
return true
|
||||
return when (capability) {
|
||||
GeodeUtils.CAPABILITY_EXTENDED_INPUT -> {
|
||||
mGLSurfaceView?.useKeyboardEvents = true
|
||||
true
|
||||
}
|
||||
GeodeUtils.CAPABILITY_TIMESTAMP_INPUT -> {
|
||||
mGLSurfaceView?.sendTimestampEvents = true
|
||||
true
|
||||
}
|
||||
else -> false
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -450,6 +450,7 @@ object GeodeUtils {
|
||||
}
|
||||
|
||||
const val CAPABILITY_EXTENDED_INPUT = "extended_input"
|
||||
const val CAPABILITY_TIMESTAMP_INPUT = "timestamp_inputs"
|
||||
|
||||
private var capabilityListener: WeakReference<CapabilityListener?> = WeakReference(null)
|
||||
|
||||
@@ -470,4 +471,7 @@ object GeodeUtils {
|
||||
external fun nativeKeyDown(keyCode: Int, modifiers: Int, isRepeating: Boolean)
|
||||
external fun nativeActionScroll(scrollX: Float, scrollY: Float)
|
||||
external fun resizeSurface(width: Int, height: Int)
|
||||
|
||||
// represents the timestamp of the next input callback, in nanoseconds (most events don't send it, but it's there)
|
||||
external fun setNextInputTimestamp(timestamp: Long)
|
||||
}
|
||||
Reference in new issue
Block a user