double tilt_x, tilt_y;
double rotation;
double size_major, size_minor;
+ bool is_down;
/* these are for the delta coordinates, but they're not
* deltas, they are converted into abs positions */
double x, y;
int first, last;
size_t mask;
+ int rx, ry;
+
+ /* pressure/distance bars */
+ rx = w->width/2 + 100;
+ ry = w->height/2 + 50;
+ cairo_save(cr);
+ cairo_set_source_rgb(cr, .2, .6, .6);
+ cairo_rectangle(cr, rx, ry, 20, 100);
+ cairo_stroke(cr);
+
+ if (w->tool.distance > 0) {
+ double pos = w->tool.distance * 100;
+ cairo_rectangle(cr, rx, ry + 100 - pos, 20, 5);
+ cairo_fill(cr);
+ }
+ if (w->tool.pressure > 0) {
+ double pos = w->tool.pressure * 100;
+ if (w->tool.is_down)
+ cairo_rectangle(cr, rx + 25, ry + 95, 5, 5);
+ cairo_rectangle(cr, rx, ry + 100 - pos, 20, pos);
+ cairo_fill(cr);
+ }
+ cairo_restore(cr);
+
/* tablet tool, square for prox-in location */
cairo_save(cr);
LIBINPUT_TABLET_TOOL_TIP_DOWN) {
w->tool.x_down = x;
w->tool.y_down = y;
+ w->tool.is_down = true;
} else {
w->tool.x_up = x;
w->tool.y_up = y;
+ w->tool.is_down = false;
}
/* fallthrough */
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
.B Tablet tools
Events from tablet tools show a cyan square at the proximity-in and
proximity-out positions. The tool position is shown as circle and increases
-in radius with increasing pressure or distance. Where tilt is available, the
-circle changes to an ellipsis to indicate the tilt angle. Relative events
-from the tablet tool are displayed as a yellow snake, always starting from
-the center of the window on proximity in. Button events are displayed in the
-bottom-most button oblong, with the name of the button displayed on press.
+in radius with increasing pressure or distance. Pressure and distance are
+also shown in the vertical bar south-east of center. Where tilt is
+available, the circle changes to an ellipsis to indicate the tilt angle.
+Relative events from the tablet tool are displayed as a yellow snake, always
+starting from the center of the window on proximity in. Button events are
+displayed in the bottom-most button oblong, with the name of the button
+displayed on press.
.TP 8
.B Tablet pads
Button events are displayed in the bottom-most button oblong, with the name