There are many gestures assigned in Talk-back. For instance all the L- gestures such as
Swipe up then right
Swipe up then left
Swipe left then down
so on
I learnt that we can assign these gestures to different actions in Talk-back settings. But can we assign them to different actions programatically? Is it possible to create new gestures similar to them?
Accessibility services have a method that allows you to detect these gestures. Override it, no need to create new gestures at all!
class YourService extends AccessibilityService {
@Override
public boolean onGesture(int gestureId) {
switch (gestureId) {
case GESTURE_SWIPE_LEFT_AND_RIGHT:
doStuff();
return true;
default:
return false;
}
}
}