ABS_MT_TOUCH_MAJOR metric
Hi,
What is the metric of ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR events?
The Linux documentation
<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt> says:
"The length of the major axis of the contact. The length should be given in surface units. ..."
What does "surface units" means, is it millimeter or pixels?
Signature · 2 lines
Thanks, ferruh
Hi Ferruh,
Quoted 10 lines · Ferruh Yigit
Hi,
What is the metric of
ABS_MT_TOUCH_MAJOR/ABS_MT_WIDTH_MAJORevents?The Linux documentation
<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt> says:
"The length of the major axis of the contact. The length should be given in surface units. ..."What does "surface units" means, is it millimeter or pixels?
It is whatever unit the device reports, similarly to ABS_MT_POSITION_X and ABS_MT_POSITION_Y. Userspace can use EVIOCGABS to map device units onto common units.
Quoted 1 line
From
include/uapi/linux/input.h(structinput_absinfo):
* Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in
* units per millimeter (units/mm), resolution for rotational axes
* (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
Hope this helps.
Signature · 1 line
Dmitry
Quoted 17 lines · Dmitry Torokhov
Hi Ferruh,
Quoted 10 lines · Ferruh Yigit
Hi,
What is the metric of
ABS_MT_TOUCH_MAJOR/ABS_MT_WIDTH_MAJORevents?The Linux documentation
<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt> says:
"The length of the major axis of the contact. The length should be given in surface units. ..."What does "surface units" means, is it millimeter or pixels?
It is whatever unit the device reports, similarly to
ABS_MT_POSITION_XandABS_MT_POSITION_Y. Userspace can use EVIOCGABS to map device units onto common units.
Quoted 8 lines
From
include/uapi/linux/input.h(structinput_absinfo):* Resolution for main axes (
ABS_X,ABS_Y,ABS_Z) is reported in
* units per millimeter (units/mm), resolution for rotational axes
* (ABS_RX,ABS_RY,ABS_RZ) is reported in units per radian.Hope this helps.
Hi Dmitry,
I understand this works for Dmitry ABS_X, ABS_Y, touchscreen reports between 0..A, screen resolution is 0..B, a mapping can be done 0..A -> 0..B
But for ABS_MT_TOUCH_MAJOR how this scaling can be done, touchscreen reports between 0..A, do we know the min/max values for application side?
Signature · 2 lines
Thanks, ferruh
Quoted 28 lines · Ferruh Yigit
Quoted 17 lines · Dmitry Torokhov
Hi Ferruh,
Quoted 10 lines · Ferruh Yigit
Hi,
What is the metric of
ABS_MT_TOUCH_MAJOR/ABS_MT_WIDTH_MAJORevents?The Linux documentation
<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt> says:
"The length of the major axis of the contact. The length should be given in surface units. ..."What does "surface units" means, is it millimeter or pixels?
It is whatever unit the device reports, similarly to
ABS_MT_POSITION_XandABS_MT_POSITION_Y. Userspace can use EVIOCGABS to map device units onto common units.Quoted 8 lines
From
include/uapi/linux/input.h(structinput_absinfo):* Resolution for main axes (
ABS_X,ABS_Y,ABS_Z) is reported in
* units per millimeter (units/mm), resolution for rotational axes
* (ABS_RX,ABS_RY,ABS_RZ) is reported in units per radian.Hope this helps.
Hi Dmitry,
Quoted 7 lines
I understand this works for Dmitry
ABS_X,ABS_Y, touchscreen reports between 0..A, screen resolution is 0..B, a mapping can be done 0..A -> 0..BBut for
ABS_MT_TOUCH_MAJORhow this scaling can be done, touchscreen reports between 0..A, do we know the min/max values for application side?
I believe in normal (all?) cases we'd use the same resolution iand limits for ABS_MT_TOUCH_MAJOR/MINOR and ABS_X/Y and kernel not report any mix/max on ABS_MT_TOUCH_MAJOR/MINOR.
Thanks.
Signature · 1 line
Dmitry
Yes, you do know the min / max values via EVICGABS. That being said, you don't want to use these values to scale from surface units to screen coordinates, as those only tell you the max reported width. ABS_MT_TOUCH_MAJOR should be in the same units that ABS_X and ABS_Y are for that device, so you should use those scaling values to do the mapping. Theoretically the resolution should be exactly the same for both, if you want to do the conversion into physical units (i.e. mm).
Quoted 45 lines · Ferruh Yigit
Quoted 17 lines · Dmitry Torokhov
Hi Ferruh,
Quoted 10 lines · Ferruh Yigit
Hi,
What is the metric of
ABS_MT_TOUCH_MAJOR/ABS_MT_WIDTH_MAJORevents?The Linux documentation
<https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt> says:
"The length of the major axis of the contact. The length should be given in surface units. ..."What does "surface units" means, is it millimeter or pixels?
It is whatever unit the device reports, similarly to
ABS_MT_POSITION_XandABS_MT_POSITION_Y. Userspace can use EVIOCGABS to map device units onto common units.Quoted 8 lines
From
include/uapi/linux/input.h(structinput_absinfo):* Resolution for main axes (
ABS_X,ABS_Y,ABS_Z) is reported in
* units per millimeter (units/mm), resolution for rotational axes
* (ABS_RX,ABS_RY,ABS_RZ) is reported in units per radian.Hope this helps.
Hi Dmitry,
I understand this works for Dmitry
ABS_X,ABS_Y, touchscreen reports between 0..A, screen resolution is 0..B, a mapping can be done 0..A -> 0..BBut for
ABS_MT_TOUCH_MAJORhow this scaling can be done, touchscreen reports between 0..A, do we know the min/max values for application side?--
Thanks,
ferruh--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Ferruh,
Quoted 7 lines
I understand this works for Dmitry
ABS_X,ABS_Y, touchscreen reports between 0..A, screen resolution is 0..B, a mapping can be done 0..A -> 0..BBut for
ABS_MT_TOUCH_MAJORhow this scaling can be done, touchscreen reports between 0..A, do we know the min/max values for application side?
You are right to be confused here. The axes you refer to are, in a way, meaningless because both TOUCH_MAJOR and TOUCH_MINOR (and the corresponding WIDTH_MAJOR and WIDTH_MINOR) are assumed to be measured in surface coordinates, i.e., of the same scale as ABS_X and ABS_Y.
Historically, these axes have had specific values anyways, as an indication of how large a touch area can be a the specific device. This is how userland MT applications interpret the data. Strictly speaking, this is incorrect, but that's how it is.
Henrik