Ticket #4685: wacom_pressure.patch

File wacom_pressure.patch, 783 bytes (added by idefix, 13 years ago)

(patch) set minimum click pressure for Wacom pen

  • src/add-ons/input_server/devices/wacom/TabletDevice.cpp

     
    3030#define JITTER_X .0007
    3131#define JITTER_Y .0007
    3232#define ACCELERATION_KICK_IN 2.3
     33#define MIN_CLICK_PRESSURE 0.2
    3334
    3435// constructor
    3536TabletDevice::TabletDevice(MasterServerDevice* parent, DeviceReader* reader)
     
    385386            break;
    386387        }
    387388    }
     389
     390    if (pressure <= MIN_CLICK_PRESSURE && mode == MODE_PEN)
     391        firstButton = false;
     392
     393    pressure = (pressure - MIN_CLICK_PRESSURE) / (1.0 - MIN_CLICK_PRESSURE);
     394
    388395    if (pressure > 1.0)
    389396        pressure = 1.0;
    390397    else if (pressure < 0.0)