![logo](website/logo.svg)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/11027/badge.svg)](https://scan.coverity.com/projects/tslib)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/libts/tslib.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/libts/tslib/context:cpp)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/752/badge)](https://bestpractices.coreinfrastructure.org/projects/752)
# C library for filtering touchscreen events
tslib consists of the library _libts_ and tools that help you _calibrate_ and
_use it_ in your environment.
## contact
If you have problems, questions, ideas or suggestions, please contact us by
writing an email to [tslib@lists.infradead.org](mailto:tslib@lists.infradead.org),
which is [our mailing list](http://lists.infradead.org/mailman/listinfo/tslib).
## website
Visit the [tslib website](http://tslib.org) for an overview of the project.
## table of contents
* [setup and configure tslib](#setup-and-configure-tslib)
* [filter modules](#filter-modules)
* [the libts library](#the-libts-library)
* [building tslib](#building-tslib)
* [hardware support](#touchscreen-hardware-support)
* [contribute](#contributors)
## setup and configure tslib
### install tslib
tslib runs on various hardware architectures and operating systems, including GNU/Linux,
FreeBSD or Android/Linux. See [building tslib](#building-tslib) for details.
Apart from building the latest tarball release, running
`./configure`, `make` and `make install`, tslib is available from distributors like
[Arch Linux](https://www.archlinux.org/packages/?q=tslib) / [Arch Linux ARM](https://archlinuxarm.org/packages/aarch64/tslib),
[Buildroot](https://buildroot.org/),
[Debian](https://tracker.debian.org/pkg/tslib) / [Ubuntu](https://launchpad.net/ubuntu/+source/tslib),
[Fedora](https://apps.fedoraproject.org/packages/tslib/) or
[OpenSUSE](https://software.opensuse.org/package/tslib)
and their package management.
### configure tslib
This is just an example `/etc/ts.conf` file. Touch samples flow from top to
bottom. Each line specifies one module and its parameters. Modules are
processed in order. Use _one_ module_raw on top, that accesses your device,
followed by any combination of filter modules.
module_raw input
module median depth=3
module dejitter delta=100
module linear
see the [section below](#filter-modules) for available filters and their
parameters. On Linux, your first commented-in line should always be
`module_raw input` which offers one optional parameter: `grab_events=1`
if you want it to execute EVIOCGRAB on the device.
With this configuration file, we end up with the following data flow
through the library:
driver --> raw read --> median --> dejitter --> linear --> application (using ts_read_mt())
module module module module
### calibrate the touch screen
Calibration is done by the `linear` plugin, which uses its own config file
`/etc/pointercal`. Don't edit this file manually. It is created by the
[`ts_calibrate`](https://manpages.debian.org/unstable/libts0/ts_calibrate.1.en.html) program:
# ts_calibrate
The calibration procedure simply requires you to touch the cross on screen,
where it appears, as accurate as possible.
![ts_calibrate](doc/screenshots/ts_calibrate.png?raw=true)
### test the filtered input behaviour
You may quickly test the touch behaviour that results from the configured
filters, using [`ts_test_mt`](https://manpages.debian.org/unstable/libts0/ts_test_mt.1.en.html):
# ts_test_mt
![ts_test_mt](doc/screenshots/ts_test_mt.png?raw=true)
On the bottom left of the screen, you see the available concurrent touch contacts
supported, and whether it's because the driver says so, or ts_test_mt was started
with the `-j` commandline option to overwrite it.
### environment variables (optional)
You may override defaults. In most cases you won't need to do so though:
TSLIB_TSDEVICE Touchscreen device file name.
Default: automatic detection (on Linux)
TSLIB_CALIBFILE Calibration file.
Default: ${sysconfdir}/pointercal
TSLIB_CONFFILE Config file.
Default: ${sysconfdir}/ts.conf
TSLIB_PLUGINDIR Plugin directory.
Default: ${datadir}/plugins
TSLIB_CONSOLEDEVICE Console device. (not needed when using --with-sdl2)
Default: /dev/tty
TSLIB_FBDEVICE Framebuffer device.
Default: /dev/fb0
### use the filtered result in your system (X.org method)
If you're using X.org graphical X server, things should be very easy. Install
tslib and [xf86-input-tslib](https://github.com/merge/xf86-input-tslib),
reboot, and you should instantly have your `ts.conf` filters running, without
configuring anything else yourself.
### use the filtered result in your system (ts_uinput method)
**TL;DR:** Run `tools/ts_uinput_start.sh` during startup and use
`/dev/input/ts_uinput` as your evdev input device.
tslib tries to automatically find your touchscreen device in `/dev/input/event*`
on Linux. Now make `ts_uinput` use it, instead of your graphical environment
directly:
# ts_uinput -d -v
`-d` makes the program return and run as a daemon in the background. `-v` makes
it print the __new__ `/dev/input/eventX` device node before returning.
Now make your graphical environment use that new input device, using **evdev**
drivers.
* For *Qt5* for example you'd probably set something like this:
QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/eventX:rotate=0
* For *X11* you'd probably edit your `xorg.conf` `Section "InputDevice"` for your
touchscreen to have
Option "Device" "/dev/input/eventX"
Please consult your input system's documentation on how to use a specific
evdev input device.
Let's recap the data flow here:
driver --> raw read --> filter(s) ... --> ts_uinput --> libevdev read --> GUI app/toolkit
module module(s) ... daemon e.g. in libinput
#### symlink /dev/input/ts_uinput to the new event file
/dev/input/event numbers are not persistent. In order to know in advance,
*what* enumerated input device file is created by `ts_uinput`, you can use
a symlink:
* use the included `tools/ts_uinput_start.sh` script that starts
`ts_uinput -d -v` and creates the symlink called `/dev/input/ts_uinput` for
you, or
* if you're using *systemd*, create the following udev rule, for
example `/etc/udev/rules.d/98-touchscreen.rules`:
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="NAME_OF_THE_TOUCH_CONTROLLER", SYMLINK+="input/ts", TAG+="systemd" ENV{SYSTEMD_WANTS}="ts_uinput.service"
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="ts_uinput", SYMLINK+="input/ts_uinput"
where `NAME_OF_THE_TOUCH_CONTROLLER` the touchscreen found in your `cat /proc/bus/input/devices | grep Name`. The first rule is only needed, if tslib doesn't automatically choose
the correct device for you.
#### running as systemd service (optional)
In case you have to use non-default paths, create a file containing the
environment for tslib, like `/etc/ts.env`
TSLIB_CALIBFILE=/etc/pointercal
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts
and create a systemd service file, like `/usr/lib/systemd/system/ts_uinput.service`
[Unit]
Description=touchscreen input
BindsTo=dev-input-ts.device
After=dev-input-ts.device
RequiresMountsFor=/etc/ts.env
[Service]
Type=forking
EnvironmentFile=/etc/ts.env
ExecStart=/usr/bin/ts_uinput -d
Adjust the paths. They could as well be in `/usr/local/` too.
### other operating systems
There is no tool that we know of that reads tslib samples and uses the
[Windows t
没有合适的资源?快使用搜索试试~ 我知道了~
迅为imx6ull驱动程序配套资料.zip
共519个文件
c:113个
o:46个
la:45个
需积分: 11 12 下载量 31 浏览量
2022-06-23
14:48:20
上传
评论 1
收藏 4.65MB ZIP 举报
温馨提示
迅为imx6ull驱动程序配套资料.zip
资源推荐
资源详情
资源评论
收起资源包目录
迅为imx6ull驱动程序配套资料.zip (519个子文件)
libts.so.0 17KB
libts.so.0 17KB
ts_calibrate.1 3KB
ts_calibrate.1 3KB
ts_uinput.1 3KB
ts_uinput.1 3KB
ts_test_mt.1 2KB
ts_test_mt.1 2KB
ts_print_mt.1 2KB
ts_print_mt.1 2KB
ts_test.1 2KB
ts_test.1 2KB
ts_verify.1 2KB
ts_verify.1 2KB
ts_finddev.1 1KB
ts_finddev.1 1KB
ts_print_raw.1 1KB
ts_print.1 1KB
ts_print_raw.1 1KB
ts_print.1 1KB
ts_conf.1 1KB
ts_conf.1 1KB
ts_harvest.1 1KB
ts_harvest.1 1KB
libts.so.0.10.3 17KB
libts.so.0.10.3 17KB
ts_read.3 5KB
ts_read_raw.3 5KB
ts_read_mt.3 5KB
ts_read_raw_mt.3 5KB
ts_read.3 5KB
ts_read_mt.3 5KB
ts_read_raw.3 5KB
ts_read_raw_mt.3 5KB
ts_libversion.3 2KB
ts_libversion.3 2KB
ts_setup.3 2KB
ts_setup.3 2KB
ts_conf_set.3 2KB
ts_conf_set.3 2KB
ts_error_fn.3 2KB
ts_error_fn.3 2KB
ts_conf_get.3 2KB
ts_conf_get.3 2KB
ts_open_restricted.3 2KB
ts_open_restricted.3 2KB
ts_close_restricted.3 2KB
ts_close_restricted.3 2KB
ts_get_eventpath.3 2KB
ts_get_eventpath.3 2KB
ts_config.3 2KB
ts_config.3 2KB
ts_open.3 1KB
ts_open.3 1KB
ts_close.3 1KB
ts_close.3 1KB
ts_fd.3 1KB
ts_fd.3 1KB
ts_print_ascii_logo.3 1KB
ts_print_ascii_logo.3 1KB
tslib_version.3 1KB
tslib_version.3 1KB
ts.conf.5 11KB
ts.conf.5 11KB
configure.ac 7KB
Makefile.am 7KB
Makefile.am 4KB
Makefile.am 3KB
Makefile.am 548B
Makefile.am 495B
Makefile.am 486B
Makefile.am 223B
app 636KB
app 578KB
app 578KB
app 578KB
app 577KB
app 577KB
app 577KB
app 577KB
app 577KB
app 8KB
AUTHORS 322B
tslib-1.21.tar.bz2 429KB
font_8x16.c 94KB
font_8x8.c 50KB
ch34x.c 35KB
ts_uinput.c 24KB
input-raw.c 24KB
input-evdev-raw.c 22KB
cy8mrln-palmpre.c 21KB
ts_verify.c 14KB
ts_calibrate.c 12KB
median.c 10KB
skip.c 10KB
variance.c 10KB
ts_test_mt.c 10KB
fbutils-linux.c 10KB
dejitter.c 9KB
evthres.c 8KB
共 519 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
药之心炎
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功