• Peter Hutterer's avatar
    tablet: apply pressure offset handling for non-distance tablets · a244b9e3
    Peter Hutterer authored
    Previously we only applied pressure offset handling for tablets that
    supported ABS_DISTANCE. Detecting a pressure offset when the tool
    doesn't actually touch the surface is easy after all.
    But tablets without distance handling may also have a pressure offset,
    so let's try to detect this. This is obviously harder since the pen will
    always touch the tablet's surface whenever it is in proximity and thus
    will always have *some* pressure applied to it.
    The process here is to merely observe the minimum pressure value during
    the first two strokes of the pen. On the third prox in, that minimum
    pressure value is taken as the offset. If the pressure drops below the
    offset, the offset is adjusted downwards [1] so over time we'll
    get closer to the pen's real offset.
    [1] this is already done for distance tablets too
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>