In the end, I found out how to do it, although it's a little tricky. Still, if a non-mega-Geek like me can do it, I'm sure most of you can too! :)
Firstly, Go to Terminal, and type this to find the name of your touchscreen, and if you have one, your touchpad (say, if you have a laptop with a touchscreen):
xinput -list
The names should be pretty obvious for each.
Now, make two "shell scripts": these are little text documents that contain several commands, which are joined up in the document to be done together (effectively creating a little program). Make them using gedit, naming them "portrait.sh" and "landscape.sh" respectively. Save them in a new folder: /home/your username/Scripts/
For PORTRAIT, type this:
#!/bin/sh
#portrait (left)
xrandr -o left
xinput set-prop "Your Touchscreen's Name" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
xinput set-prop "Your Touchpad's name, if applicable" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
Next, for LANDSCAPE:
#!/bin/sh
#landscape (normal)
xrandr -o normal
xinput set-prop "Your Touchscreen's Name" --type=float "Coordinate Transformation Matrix" 0 0 0 0 0 0 0 0 0
xinput set-prop "Your Touchpad's name, if applicable" --type=float "Coordinate Transformation Matrix" 0 0 0 0 0 0 0 0 0
If you don't have a touchpad, you can leave out that line of code for each shell script.
Afterwards, I also made launchers to automatically run each shell script when I tapped on them (this is possible in Xubuntu, Ubuntu MATE, and many other Ubuntu flavours). To do so, go to your panel, right-click, click on "add to panel" (or equivalent, for all these subsequent commands, too), create a custom application launcher. For portrait's launcher, put in this command:
sh /home/username/Scripts/portrait
For landscape's launcher, put in this command:
sh /home/username/Scripts/landscape
I also made a "super+" keyboard shortcut for each of them. Find your "keyboard shortcuts" settings program (under Settings in many flavours, or just search for it). Effectively, do the same thing as you did with the panel launchers: Add a new keyboard shortcut, Name it Portrait and give it the command, "sh /home/username/Scripts/portrait", and do the equivalent for Landscape. Then give each of them a keyboard shortcut (say Super+P and Super+L respectively... although be aware Super+P is sometimes the standard keyboard shortcut for your Display Settings).
I STRONGLY recommend you make a keyboard shortcut for LANDSCAPE - that way, if your touch stops working, you can at least get out of Portrait, and back to Landscape successfully (VERY USEFUL).
For more information, go here. http://ubuntuforums.org/showthread.php?t=1972447
(This link - https://wiki.ubuntu.com/X/InputCoordinateTransformation - will also help you understand a little of the theory behind it...)
I'm trying out Ubuntu via a live usb on the Yoga 13 right now.
The Yoga 2 Pro is the reboot of that device.
Anyway, the are no issues with the touchscreen for me on 13.10.
The buttons seem no smaller than they are in Windows, so there's that.
I haven't installed the driver to enable wifi, but purchased a $10 Edimax usb adapter that is doing the trick.
Pinch-to-zoom isn't there (bummer), but the grab and drag addon for Firefox makes it pleasant to navigate the Internet by touch.
There are addons like that for Chrome as well.
Best Answer
I found a straightforward answer to my question by reading the helpful information at Ubuntu Wiki: X - Input Coordinate Transformation.
These commands can be used to align rotations of the input devices and the display:
The first command rotates the display, where can be left, right, normal, or inverted:
xrandr -o <orientation>
remap the input device:
xinput set-prop '<device name>' 'Coordinate Transformation Matrix' <matrix-elements-rowwise>
The second command remaps the input device (that is, the touchpad or the the touchscreen) where
<matrix-elements-rowwise>
is0 -1 1 1 0 0 0 0 1
,0 1 0 -1 0 1 0 0 1
,1 0 0 0 1 0 0 0 1
, or-1 0 1 0 -1 1 0 0 1
; corresponding to the orientations above.The names of the touchpad and touchscreen can be found with
xinput list
and either can be disabled entirely withxinput disable <device-name>
. Subsequently,xinput enable <device-name>
will re-enable the input device.In my case, and probably for others with a Yoga 13 (also on Yoga 2 Pro), the touchscreen is called
ELAN Touchscreen
and the touchpadSynPS/2 Synaptics TouchPad
.Thus, I put a short script in my home directory called
rotate-inverted.sh
with the following content:Then I made the script executable with
and assigned the command
~/rotate-inverted.sh
to the keyboard shortcut Ctrl+Alt+I inSystem Settings -> Keyboard.
After I logged out and logged back in, I was able to rotate the keyboard by pressing that shortcut.
I did the same type of thing for the other rotation positions, using the commands
xinput enable 'SynPS/2 TouchPad'
andkillall onboard
instead ofxinput disable 'SynPS/2 TouchPad'
andonboard &
forrotate-normal.sh
.Some others on this thread have discussed assigning such scripts to the extra buttons on the
Yoga — such as the lock button — as well as automatically executing them upon changing the Yoga's position; but I was not sure how to do this.