Lines Matching refs:pressure
364 * threshold is 0 pressure.
366 int base = tool->pressure.threshold.lower;
538 tablet->axes.pressure = normalize_pressure(absinfo, tool);
730 axes.pressure = tablet->axes.pressure;
1085 const struct input_absinfo *pressure, *distance;
1091 tool->pressure.offset = 0;
1092 tool->pressure.has_offset = false;
1094 pressure = libevdev_get_abs_info(device->evdev, ABS_PRESSURE);
1095 if (!pressure)
1103 tool->pressure.offset = pressure->minimum;
1104 tool->pressure.heuristic_state = PRESSURE_HEURISTIC_STATE_DONE;
1106 tool->pressure.offset = pressure->maximum;
1107 tool->pressure.heuristic_state = PRESSURE_HEURISTIC_STATE_PROXIN1;
1110 /* 5 and 1% of the pressure range */
1111 hi = axis_range_percentage(pressure, 5);
1112 lo = axis_range_percentage(pressure, 1);
1117 "Invalid pressure range, using defaults\n");
1124 tool->pressure.threshold.upper = hi;
1125 tool->pressure.threshold.lower = lo;
1258 *pressure;
1261 pressure = libevdev_get_abs_info(tablet->device->evdev, ABS_PRESSURE);
1263 if (!pressure || !distance)
1273 * down". We use the lower threshold as minimum pressure value,
1275 tool_in_contact = (pressure->value > tool->pressure.threshold.lower);
1277 /* Keep distance and pressure mutually exclusive */
1280 pressure->value > pressure->minimum) {
1288 tablet->axes.pressure = 0;
1292 if (tablet->axes.pressure == 0)
1296 tablet->axes.pressure = 0;
1323 tool->pressure.offset = offset;
1324 tool->pressure.has_offset = true;
1330 int gap = tool->pressure.threshold.upper - tool->pressure.threshold.lower;
1331 tool->pressure.threshold.lower = offset;
1332 tool->pressure.threshold.upper = offset + gap;
1340 const struct input_absinfo *pressure =
1343 if (!pressure ||
1349 * higher-than-needed pressure offset and then we'd be tied into a
1350 * high pressure offset for the rest of the session.
1355 int offset = pressure->value;
1356 if (tool->pressure.has_offset) {
1357 if (offset < tool->pressure.offset)
1359 } else if (tool->pressure.heuristic_state != PRESSURE_HEURISTIC_STATE_DONE) {
1360 tool->pressure.offset = min(offset, tool->pressure.offset);
1369 const struct input_absinfo *pressure, *distance;
1372 if (tool->pressure.has_offset ||
1376 pressure = libevdev_get_abs_info(device->evdev, ABS_PRESSURE);
1379 if (!pressure)
1382 offset = pressure->value;
1383 if (offset <= pressure->minimum)
1387 /* If we're closer than 50% of the distance axis, skip pressure
1392 /* A device without distance will always have some pressure on
1398 if (offset > pressure->minimum)
1399 tool->pressure.offset = min(offset, tool->pressure.offset);
1401 switch (tool->pressure.heuristic_state) {
1404 tool->pressure.heuristic_state++;
1407 tool->pressure.heuristic_state++;
1408 offset = tool->pressure.offset;
1415 if (offset <= pressure->minimum)
1418 if (offset > axis_range_percentage(pressure, 50)) {
1420 "Ignoring pressure offset greater than 50%% detected on tool %s (serial %#x). "
1444 int pressure;
1449 /* if we have pressure, always use that for contact, not BTN_TOUCH */
1461 "Missing pressure axis\n");
1464 pressure = p->value;
1466 if (pressure <= tool->pressure.threshold.lower &&
1469 } else if (pressure >= tool->pressure.threshold.upper &&