Touch screen linux debian

Touch screen linux debian

Background

  • Slimline tablet computers have become more popular recently
    • These devices typically have a touchscreen and no keyboard. However, they support bluetooth keyboards for those who really need it.
    • They are a laptop with a keyboard, but the screen can be rotated to cover the keyboard, creating a tablet device
    • They are becoming more popular due to the convenience of tablet computing (e.g. convenience of taking out the device while on the bus, where it is convenient to read from a tablet but not comfortable to open a laptop and use a keyboard)

    Requirements/user expectations

    • Using the finger to scroll (e.g. in a PDF)
      • This is actually very different to using a scrollbar, and many apps don’t support it
      • e.g. user can zoom or rotate an image by touch the screen with two fingers, and moving the fingers in different directions across the screen, as many smartphones can do.

      Current status

      • Many of these things don’t happen `out of the box’ with Debian
      • Some things can be achieved with small changes (e.g. removing evince and installing okular, a screen reader that supports touch)
      • Some things require moderate amount of effort, e.g. using the Thinkpad X220 Tablet is not possible with the Xorg version in Squeeze. The user must update their kernel (from backports) and take the Xorg packages from sid.
      • Some things require effort (writing a script to handle rotation events and invoking xrandr in a meaningful way for the particular device)

      Useful packages

      • okular — screen reader for PDF, ebooks, with touch scrolling support
      • xournal — support for stylus with draw and eraser functions
      • xserver-xorg-input-wacom — Wacom tablet support for Xorg
      • xserver-xorg-input-multitouch — for multi-touch input
      • gok — Gnome On-screen Keyboard
      • florence — another on-screen keyboard
      • caribou — an alternative to gok
      • Iceweasel add-ons
        • «Grab and Drag» — enables grabbing type scrolling within Iceweasel
        • WacomTablets — for Thinkpads tablets too
        • http://florence.sourceforge.net/english/alternatives.html — list of on-screen keyboards for Gnome / X
        • http://live.gnome.org/Caribou
        • http://florence.sourceforge.net/english.html

        Fixing tap on touch screens

        somewhere between Section and EndSection.

        But be aware that will block screen gestures like resizing with two fingers.

        Thinkpad-specific

        Источник

        KurtJacobson / touchscreen_calibration.md

        Unfortunately xinput-calibrator does not work at all for calibrating a touchscreen in Debian9. This is apparently because X server now uses libinput to handle input devices instead of evdev. I spent huge amount of trying to fiddling with xinput-calibrator and 99-calibration.conf files until I finely found this issue on GitHub that gave me some hints as how to proceed. This is mostly for my own reference, but I hope it might also help others in the same situation.

        This not not seem to be installed by defaults on Debian9

        $ sudo apt-get install xinput

        Determine the screen size

        You probably already know this, but if you have multiple screens they might be see as one big screen. So to determine the total size run

        This will print out a good bit of information, but what you are interested in is the current vales in the first line, which will look something like this:

        Screen 0: minimum 320 x 200, current 1440 x 900, maximum 8192 x 8192

        Determine the name of the touch device

        Next step it to find the touch device’s name

        Look for the touch device in the Virtual core pointer section. In my case the device name is Elo TouchSystems 2700 IntelliTouch(r) .

        ⎡ Virtual core pointer [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer [slave pointer (2)] ⎜ ↳ Elo TouchSystems 2700 IntelliTouch(r) [slave pointer (2)] ⎜ ↳ 2.4G Mouse [slave pointer (2)] ⎣ Virtual core keyboard [master keyboard (2)] ↳ Virtual core XTEST keyboard [slave keyboard (3)] . 

        were is the name you determined in the last step.

        Confirm that the list of properties includes near the top a property called Coordinate Transformation Matrix . If it does not, you probably have the wrong device name.

        Set the Coordinate Transformation Matrix

        The screen is calibrated using a Coordinate Transformation Matrix , which defaults to the identity matrix.

        for convenient entry, the matrix is flatted into a single line like this

        were the valuse seem to map like this

        [hscale] [vskew] [hoffset] [hskew] [vscale] [voffset] 0 0 1

        Here is a very nice interactive tool for visualizing the effect of the various values: https://codepen.io/GottZ/full/d73f2f844b52b91b7457febce2d1b18c/

        Apply the calibration matrix by saying

        xinput set-prop » ‘Coordinate Transformation Matrix’ 1.04 0 -0.02 0 1.04 -0.02 0 0 1

        I just experimented with the values until I had the scree calibrated, it only took a few iterations to get so the pointer was exactly under were I touched.

        Источник

        Touchscreen install and setup in Ubuntu and Debian

        Dear Community,
        Touchscreens in Ubuntu and Debian is sometimes a feckin matter.
        I will describe a solution on my example with a Panel PC with a PenMount 9000 serial Touchscreen.
        Its tested in Ubuntu 12.04.5 32Bit and Debian Buster 10.10 Preemt Kernel 64Bit ( LinuxCNC ISO )
        My first was to try the original driver package from PenMount, but doesnt works.

        My Solution it works on linux packages «inputattach», «xinput-calibrator» and the driver «evdev»

        — open a shell
        «sudo apt-get install inputattach»
        «sudo apt-get install xinput-calibrator»
        «sudo apt-get install xserver-xorg-input-evdev»
        Now, you have to know, on what kind of serial port is working your Touchscreen.
        Touch with your finger at the Touchscreen, you can check data «sudo cat /proc/tty/driver/serial»
        If you find nothing is maybe the Touchscreen on a other serial port.
        After installing the OS you find 4 serial ports in /dev/ttyS0 to /dev/ttyS3
        in my sample is the Touchscreen on /dev/ttyS5
        We have to build in the OS 2 serial ports more
        — open a shell
        «sudo thuna» or in Ubuntu «sudo nautilus» to start a file manager with «sudo» rights
        Change a line in /etc/default/grub
        GRUB_CMDLINE_LINUX_DEFAULT=»quiet 8250.nr_uarts=6″
        and save
        in the shell «sudo update-grub»
        after reboot the OS
        After rebooting you will find /dev/ttyS0 until /dev/ttyS5
        To get the Touchscreen the right driver we have to change one line in :
        /usr/share/X11/xorg.conf.d/40-libinput.conf

        Look at the «Touchscreen» Section
        enter this line
        driver «evdev»
        and save
        reboot your OS
        After rebooting check the touchscreen
        -open a shell
        «sudo inputattach —deamon —always -pm9k /dev/ttyS5»
        now should be working the touchscreen, please execute xinput-calibrator for calibrate the Touchscreen.

        The last step is, after rebooting the touchscreen should be working automatically.
        We need in /etc/ a «rc.local»
        It isnt in «/etc/ ,then we build one with an Editor

        #!/bin/sh -e
        #
        # rc.local
        #
        # This script is executed at the end of each multiuser runlevel.
        # Make sure that the script will «exit 0» on success or any other
        # value on error.
        #
        # In order to enable or disable this script just change the execution
        # bits.
        #
        # By default this script does nothing.
        inputattach —daemon —always -pm9k /dev/ttyS5
        exit 0
        Save and dont forget to give the «rc.local» the rights to execute
        After a reboot will workring the touchscreen automatically.

        *-pm9k is for a PenMount 9000 Touchscreen if you have others, please check on a shell with «inputattach —help»
        you get a list of driver modes.

        Please Log in or Create an account to join the conversation.

        Источник

        Debian in more depth: adding touch support

        There are two options for touchscreen support in X-Windows:

        xserver-xorg-input-evtouch - Touchscreen-Driver for X.Org/XFree86 server xserver-xorg-input-tslib - tslib touchscreen driver for X.Org/XFree86 server

        The first uses the input event layer of Linux to read directly from touchscreen devices. The second uses a library named tslib to perform filtering and translation of raw coordinates from a touchscreen device in order to generate X-Windows events.

        In this post, I’m going to walk through the details of tslib , since I haven’t yet had any success in getting evtouch calibration to work.

        Before we start, we’ll need to add another package to our installation. The libts-bin package contains the touchscreen calibration and test utilities for tslib .

        debian:~# apt-get install libts-bin

        We’ll also need to configure tslib through the use of /etc/ts.conf . The following is a pretty typical setup that tells tslib to read from the input event layer, perform a little filtering, and translate the results into screen coordinates.

        # Uncomment if you wish to use the linux input layer event interface module_raw input # Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d # module_raw collie # Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860 # module_raw corgi # Uncomment if you're using a device with a UCB1200/1300/1400 TS interface # module_raw ucb1x00 # Uncomment if you're using an HP iPaq h3600 or similar # module_raw h3600 # Uncomment if you're using a Hitachi Webpad # module_raw mk712 # Uncomment if you're using an IBM Arctic II # module_raw arctic2 module pthres pmin=1 module variance delta=30 module dejitter delta=100 module linear

        Once this file is created, we can use the ts_calibrate and ts_test utilities to calibrate and test the touchscreen. Note that you’ll need to set the TSLIB_TSDEVICE environment variable to tell tslib what input device is the touchscreen. It’s typically /dev/input/event0 because the touchscreen driver is loaded early in platform initialization.

        ts_calibrate will prompt you to touch each of five points. This calibration routine helps it to determine how it should scale and translate raw input readings to produce screen locations.

        debian:~# export TSLIB_TSDEVICE=/dev/input/event0 debian:~# ts_calibrate

        ts_calibrate screenshot

        After touching these points, you can see the set of coefficients it produced in /etc/pointercal .

        debian:~# cat /etc/pointercal 243 54107 -2786888 32553 -1 -1549556 6553636debian:~#

        You can also test the touchscreen with the ts_test utility. It will allow you to either drag a cross-hair icon around on the screen or draw lines between the points it reads:

        ts_test screenshot

        The next step is to configure X-Windows to use the touchscreen driver. We do this by adding an InputDevice section to /etc/X11/xorg.conf :

        Section "InputDevice" Identifier "tslib" Driver "tslib" Option "ScreenNumber" "0" Option "Width" "800" Option "Height" "480" Option "Rotate" "NONE" Option "TslibDevice" "/dev/input/event3" Option "CorePointer" EndSection

        Once you’ve done this, you can startx and things will almost work. You should see the pointer move as you touch various points on the screen and move in the right directions, but the scaling won’t work properly.

        Many thanks to Ricardo Soza for figuring this one out. It’s a known bug with a known fix. Here’s the workaround:

        debian:~# apt-get build-dep xserver-xorg-input-tslib && apt-get source xserver-xorg-input-tslib . update xf86-input-tslib_0.0.4/src/tslib with the patch below debian:~# cd xf86-input-tslib_0.0.4 debian:~/xf86-input-tslib-0.0.4# debian/rules binary

        I got the patch by screen-scraping the bug report:

        Index: src/tslib.c =================================================================== --- a/src/tslib.c (revision 28) +++ b/src/tslib.c (working copy) @@ -184,9 +184,11 @@ InputInfoPtr pInfo; unsigned char map[MAXBUTTONS + 1]; int i; + struct ts_priv *priv; ErrorF("%sn", __FUNCTION__); pInfo = device->public.devicePrivate; + priv = pInfo->private; switch (what) < case DEVICE_INIT: @@ -222,15 +224,17 @@ return !Success; >- InitValuatorAxisStruct(device, 0, 0, /* min val */ 1023, /* max val */ - 1024, /* resolution */ - 0, /* min_res */ - 1024); /* max_res */ + InitValuatorAxisStruct(device, 0, 0, /* min val */ + priv->width - 1, /* max val */ + priv->width, /* resolution */ + 0, /* min_res */ + priv->width); /* max_res */ - InitValuatorAxisStruct(device, 1, 0, /* min val */ 1023, /* max val */ - 1024, /* resolution */ - 0, /* min_res */ - 1024); /* max_res */ + InitValuatorAxisStruct(device, 1, 0, /* min val */ + priv->height - 1,/* max val */ + priv->height, /* resolution */ + 0, /* min_res */ + priv->height); /* max_res */

        Once done, you can restart the X-server and move the mouse pointer around with the touchscreen!

        Источник

        Читайте также:  Os x mavericks on linux
Оцените статью
Adblock
detector