Enable Touch Screen for Google Chrome in Ubuntu 14.10

My lappy, the Samsung 915S3G (see result below) which has touch screen support since the first day I've bought but never bother about it until today.
$ sudo dmidecode | grep "System Information" -A 3
System Information
    Product Name: 905S3G/906S3G/915S3G
    Version: P03RBV

Since I've been reading a lot of PDF files and the keyboard of this lappy is just atrocious, is best to enable and calibrate touch screen support to obtain the best usage experience.

First, let's install the calibration program to detect your device manufacture name. This will be useful later when you want to set the default input device to Google Chrome.
$ sudo apt-get install xinput-calibrator

Run the calibration program, touch four points on your screen to calibrate your device, and save the result. As shown below, our touch screen device name is "ELAN Touchscreen" with id of 12.
$ xinput_calibrator 
        Setting calibration data: 0, 3776, 0, 2112
Calibrating EVDEV driver for "ELAN Touchscreen" id=12
        current calibration values (from XInput): min_x=0, max_x=3776 and min_y=0, max_y=2112

Doing dynamic recalibration:
        Setting calibration data: -15, 3795, 1, 2118
        --> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ELAN Touchscreen"
        Option  "Calibration"   "-15 3795 1 2118"
        Option  "SwapAxes"      "0"

Alternatively, we can find the device id of our touch screen device using the xinput command below. The device id we need is 12.
$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=11   [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ WebCam SC-10HDD13335N                     id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]

Lastly, we'll start Google Chrome browser by setting the input device id found above.
$ google-chrome --touch-devices=12

No comments:

Post a Comment