68
68
#define TOUCH_MAX_SLOTS 10 /* fallback if not found */
69
69
#define TOUCH_SAMPLES_READ 3 /* up to, if available */
70
70
#define MAXBUTTONS 11 /* > 10 */
71
- #define TOUCH_NUM_AXES 2 /* x, y */
71
+ #define TOUCH_NUM_AXES 3 /* x, y, pressure */
72
72
73
73
#if GET_ABI_MAJOR (ABI_XINPUT_VERSION ) >= 23
74
74
#define HAVE_THREADED_INPUT 1
@@ -120,6 +120,7 @@ static void ReadInputLegacy(InputInfoPtr local)
120
120
if (type != XI_TouchEnd ) {
121
121
valuator_mask_set_double (m , 0 , samp .x );
122
122
valuator_mask_set_double (m , 1 , samp .y );
123
+ valuator_mask_set_double (m , 2 , samp .pressure );
123
124
}
124
125
125
126
xf86PostTouchEvent (local -> dev , 0 , type , 0 , m );
@@ -155,6 +156,7 @@ static void ReadHandleMTSample(InputInfoPtr local, int nr, int slot)
155
156
if (type != XI_TouchEnd ) {
156
157
valuator_mask_set_double (m , 0 , priv -> samp_mt [nr ][slot ].x );
157
158
valuator_mask_set_double (m , 1 , priv -> samp_mt [nr ][slot ].y );
159
+ valuator_mask_set_double (m , 2 , priv -> samp_mt [nr ][slot ].pressure );
158
160
}
159
161
160
162
xf86PostTouchEvent (local -> dev , priv -> touchids [slot ], type , 0 , m );
@@ -288,6 +290,15 @@ static int xf86TslibControlProc(DeviceIntPtr device, int what)
288
290
0 , /* min_res */
289
291
priv -> height , /* max_res */
290
292
Absolute );
293
+
294
+ InitValuatorAxisStruct (device , 2 ,
295
+ XIGetKnownProperty (AXIS_LABEL_PROP_ABS_PRESSURE ),
296
+ 0 , /* min val */
297
+ 255 , /* max val */
298
+ 256 , /* resolution */
299
+ 0 , /* min_res */
300
+ 256 , /* max_res */
301
+ Absolute );
291
302
} else {
292
303
InitValuatorAxisStruct (device , 0 ,
293
304
XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_POSITION_X ),
@@ -306,6 +317,15 @@ static int xf86TslibControlProc(DeviceIntPtr device, int what)
306
317
0 , /* min_res */
307
318
priv -> height , /* max_res */
308
319
Absolute );
320
+
321
+ InitValuatorAxisStruct (device , 2 ,
322
+ XIGetKnownProperty (AXIS_LABEL_PROP_ABS_MT_PRESSURE ),
323
+ 0 , /* min val */
324
+ 255 , /* max val */
325
+ 256 , /* resolution */
326
+ 0 , /* min_res */
327
+ 256 , /* max_res */
328
+ Absolute );
309
329
}
310
330
311
331
if (InitTouchClassDeviceStruct (device ,
0 commit comments