Add support for swipe gestures from lpm state

Didn't get it at first; a comment like "Using local variables, so this also works when r == a and/or when r == b."