Skip to content
  • Matt Mayfield's avatar
    touchpad: 90-degree scroll helper · bb87a3d9
    Matt Mayfield authored
    This makes two-finger scrolling in straight lines easier, while still
    allowing free/diagonal movement. It works in three stages:
    
    1) Initial movement
       - For the first few millimeters, scroll movements within 30 degrees
         of horizontal or vertical are straightened to 90-degree angles.
       - Scroll movements close to 45 degree diagonals are unchanged.
       - If movement continues very close to straight horizontal or
         vertical, stage 2 begins and the axis lock engages.
       - If movement continues along a diagonal, stage 2 is skipped and
         free scrolling is immediately enabled.
    2) Axis lock
       - If the user scrolls fairly closely to straight vertical, no
         horizontal movement will happen at all, and vice versa.
       - It is possible to switch between straight vertical and straight
         horizontal, and the axis lock will automatically change.
       - If deliberate diagonal movement is detected at any point, stage
         3 begins and the axis lock disengages.
    3) Free scrolling
       - Scrolling is unconstrained until the fingers are lifted.
    bb87a3d9