Linux系统下Libinput驱动的应用(主要在触摸屏校准)

本文介绍了Linux系统中,特别是在Ubuntu 17.10及Fedora 22等发行版下,如何应对Libinput驱动对触摸屏校准的影响。Libinput支持的设备包括多点触摸屏、单点触摸屏和数位板。绝对坐标设备的处理、缺失分辨率的设备处理和校准方法进行了详细阐述,包括设置校准矩阵以适应屏幕和设备的精确映射。
摘要由CSDN通过智能技术生成

在浸泡在旧的解决问题方法的过去,突然来了个新的情况(LUbuntu17.10下实现触摸屏的校准),这让我想到

“一个幽灵在欧洲的上空徘徊,XXXX的一声枪响”

惊醒了某些沉睡的领导,老办法不行了,要学习研究新办法了。

于是任务来了。

         经查文档之后发现,  Ubuntu17.10以及Fedora 22等Linux系统都使用了整合evdev驱动之后的libinput驱动,之前的触摸校准的方式原理还是一样,配置方式还是一样,libinput需要的校准参数(A,B,C,D,E,F)不一样了,而evdev的校准参数(Xmin,Xmax,Ymin,Ymax);

找不到写的了,先贴下来:

链接:https://wayland.freedesktop.org/libinput/doc/latest/absolute_axes.html

Absolute axes

Devices with absolute axes are those that send positioning data for an axis in a device-specific coordinate range, defined by a minimum and a maximum value.

Compare this to relative devices (e.g. a mouse) that can only detect directional data, not positional data.

libinput supports three types of devices with absolute axes:

Touchpads are technically absolute devices but libinput converts the axis values to directional motion and posts events as relative events. Touchpads do not count as absolute devices in libinput.

For all absolute devices in libinput, the default unit for x/y coordinates is in mm off the top left corner on the device, or more specifically off the device's sensor. If the device is physically rotated from its natural position and this rotation was communicated to libinput (e.g. by setting the device left-handed), the coordinate origin is the top left corner of in the current rotation.

Handling of absolute coordinates

In most use-cases, absolute input devices are mapped to a single screen. For direct input devices such as touchscreens the aspect ratio of the screen and the device match. Mapping the input device position to the output position is thus a simple mapping between two coordinates. libinput provides the API for this with

libinput's API only provides the call to map into a single coordinate range. If the coordinate range has an offset, the compositor is responsible for applying that offset after the mapping. For example, if the device is mapped to the right of two outputs, add the output offset to the transformed coordinate.

Devices without x/y resolution

An absolute device that does not provide a valid resolution is considered buggy and must be fixed in the kernel. Some touchpad devices do not provide resolution, those devices are correctly handled within libinput (touchpads are not absolute devices, as mentioned above).

Calibration of absolute devices

Absolute devices may require calibration to map precisely into the output range required. This is done by setting a transformation matrix, see libinput_device_config_calibration_set_matrix() which is applied to each input coordinate.

cosθsinθ0sinθcosθ0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值