Some time ago, I bought a Dell Latitude XT2. In a nutshell, it’s a medium-sized laptop which has a convertible touch/tablet screen.
Both touch and tablet have their uses, but during my first serious contact, I had to realise that the touch screen is not always useful: while I was drawing a picture with the pen, my palm activated the touch screen, resulting in lots of dots and occasional lines where they didn’t belong.
The internet proved to be less useful than I had hoped for, since most solutions referred to xorg.conf – which ceased to exist for Ubuntu with 11.10 (oneiric) for whatever reason.
However, there are different methods to achieve this which I will summarise here.
Step 1: Deactivating the touch screen
First, you need to find out the name of your touch screen using xinput –list, which should give you a list like this:
⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ N-Trig Touchscreen id=12 [slave pointer (2)] ⎜ ↳ N-Trig Pen stylus id=13 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=15 [slave pointer (2)] ⎜ ↳ N-Trig Pen eraser id=17 [slave pointer (2)] ⎜ ↳ N-Trig Pen pad id=18 [slave pointer (2)] ⎜ ↳ N-Trig MultiTouch id=11 [slave pointer (2)]
Since N-Trig Touchscreen didn’t work for me, I picked N-Trig MultiTouch which did the trick for me. Now, you can switch it off using
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0
and back on using 1 instead of 0.
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 1
Step 2: Rotating the screen
You can find out your screen’s name using xrandr –current, which should give you something like
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm panning 1280x800+0+0 1280x800 60.1*+ 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis)
As you can see, LVDS1 is listed as connected. It can now be rotated using
xrandr --output LVDS1 --fb 1280x800 --rotate inverted
–output specifies which output device is to be modified
–fb 1280×800 specifies the screen resolution (strictly, this is not needed for a 180° rotation)
–rotate inverted (right/left/normal) rotates the screen 180° (90° clockwise/90° counter-clockwise/standard orientation)
For 90° rotations, you also need to adapt the resolution with –fb 800×1280.
Step 3: Rotating input devices
Finally, the input devices also have to be rotated in order to match the screen.
Using the above rotation method, mouse input (and touchpoint/touchpad input) is already rotated correctly.
xsetwacom set "N-Trig Pen stylus" Rotate half
Again, you need the device names. All devices that can be altered using xsetwacom can be found using xsetwacom –list.
Rotate none sets the orientation back to normal.
Note that rotating left and right may seem slightly unintuitive :
Rotate cw rotates the input 90° left and
Rotate ccw rotates it 90° right.
The touchscreen has to be rotated differently, but so far I haven’t tried it yet (once I have, I will add the solution here – in theory it can be done using xinput).
The scripts
180°
xrandr --output LVDS1 --fb 1280x800 --rotate inverted xsetwacom set "N-Trig Pen stylus" Rotate half xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0
90° left
xrandr --output LVDS1 --fb 800x1280 --rotate left xsetwacom set "N-Trig Pen stylus" Rotate cw xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0
90° right
xrandr --output LVDS1 --fb 800x1280 --rotate right xsetwacom set "N-Trig Pen stylus" Rotate ccw xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0
Back to normal
xrandr --output LVDS1 --fb 1280x800 --rotate normal xsetwacom set "N-Trig Pen stylus" Rotate none xinput set-prop "N-Trig MultiTouch" "Device Enabled" 1





