Added the concept of a 'flick' gesture. This uses the VelocityTracker object in Android and passes the velocity info down as an SDL joystick trackball event. We can then reinterpret this event in whatever way we like, such as up/down swipes in the deck editor (that was my initial thought, at any rate).
TBD: right now every up finger generates this event. We probably want to throttle it to only be an event if the velocity exceeds some arbitrary threshold; similarly, if we generate a flick event, we probably don't want to simultaneously generate a finger up action (ie JGE_BTN_OK).
This commit is contained in:
@@ -128,6 +128,13 @@ extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
|
||||
Android_OnTouch(index, action, x, y, p);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_libsdl_app_SDLActivity_onNativeFlickGesture(
|
||||
JNIEnv* env, jclass jcls,
|
||||
jfloat xVelocity, jfloat yVelocity)
|
||||
{
|
||||
Android_OnFlickGesture(xVelocity, yVelocity);
|
||||
}
|
||||
|
||||
// Accelerometer
|
||||
extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
|
||||
JNIEnv* env, jclass jcls,
|
||||
|
||||
Reference in New Issue
Block a user