SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-08-06 09:42:24

skbierm
#! Member
From: Germany
Registered: 2012-07-17
Posts: 89

Touch screen and screen rotation

I use a Panasonic CF-19 as my main machine, which has a touch screen and is convertible to become a tablet instead of a notebook. Today I was so lazy and wanted to use it the first time as a kind of ebook reader and wanted to use the touch input for scrolling the book. Bingo - the input wasn't rotated. I used to write four little scripts and added four keyboard mappings to openbox rc.xml script.

I read in the forum, that (a long time ago) someone was on the search for the same solution, so for anyone searching next, here are the scripts ...

rotate-inverted

#/bin/bash
xrandr -o inverted
xinput set-prop 'Fujitsu Component USB Touch Panel' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1

rotate-normal

#/bin/bash
xrandr -o normal
xinput set-prop 'Fujitsu Component USB Touch Panel' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1

rotate-left

#/bin/bash
xrandr -o left
xinput set-prop 'Fujitsu Component USB Touch Panel' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1

rotate-right

#/bin/bash
xrandr -o right
xinput set-prop 'Fujitsu Component USB Touch Panel' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1

I got the name of the touch input screen via xinput list.

I added the four scripts as key combinations in the rc.xml of openbox:

    <keybind key="W-A-C-Left">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Xrand</name>
        </startupnotify>
        <command>rotate-left</command>
      </action>
    </keybind>
    <keybind key="W-A-C-Right">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Xrand</name>
        </startupnotify>
        <command>rotate-right</command>
      </action>
    </keybind>
    <keybind key="W-A-C-Up">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Xrand</name>
        </startupnotify>
        <command>rotate-normal</command>
      </action>
    </keybind>
    <keybind key="W-A-C-Down">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Xrand</name>
        </startupnotify>
        <command>rotate-inverted</command>
      </action>
    </keybind>

As a last addition, I added a line to my openbox autostart, to calibrate the touch screen on every start:

xinput set-int-prop "Fujitsu Component USB Touch Panel" "Evdev Axis Calibration" 32 293 3989 69 3591 &

To know the correct calibration, you need to use the tool xinput_calibrate.

I hope, this might help someone else smile


Running #! on
* Lenovo ThinkPad Edge e420s, Intel Core i5-2430M, 8 GB Ram, 320 GB HD, 1366x768, Intel GMA HD 3000 + AMD Radeon HD 6630M 2GB
* ASUS F55A-091D, Intel Pentium B980, 4 GB Ram, 500 GB HD, Intel HD Graphics, 1366x768
* Panasonic ToughBook CF-19, Intel Core Duo U7500, 4 GB Ram, 500 GB HD, Intel GMA 950, 1024x768 Touchdisplay

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo