Enable autorotate on a Microsoft Surface Pro Tablet running Linux. #complete
Go to file
Elf M. Sternberg 6d67d72d2c STYLE Some feedback prompted me to add commentary.
Documented what the heck I meant by 'ptx', 'lsi', etc. etc.  Also where
the numbers came from, but the simplest answer is that you start a
simple dump of the registers to your console while holding the device
in your hand and you rotate it to the various positions, writing down
the numbers you see and then tuning as necessary.  Programming as an
empirical science, not a theoretical one.

Also: I have a really (REALLY) silly script that lets me see all the
projects currently underway in my ~/Projects directory, and it looks for
the DESCRIPTION.md file.  So that's what you're getting.
2018-02-12 18:34:01 -08:00
autorotate STYLE Some feedback prompted me to add commentary. 2018-02-12 18:34:01 -08:00
DESCRIPTION.md STYLE Some feedback prompted me to add commentary. 2018-02-12 18:34:01 -08:00
README.md Re-wrote README to reflect current usage and installation. 2017-11-12 16:14:40 -08:00

README.md

Surface3-Scripts

This program autorotates the screen of a Microsoft Surface Pro 3 Tablet running Linux. It correctly performs the autorotation for all major pointer devices, including the stylus and eraser devices. It also enables palm rejection (meaning you can rest your hand on the screen while drawing) when the stylus and eraser devices are "in use" (which is defined by the digitizer as "within approximately 4cm of the screen").

This program is written in Python 2, which is included in all major Linux distributions by default. It has no additional dependencies.

It may run on other versions of the Microsoft Surface, but I haven't tested it on anything other than my own Surface Pro 3.

Installation

To install, just copy autorotate/autorotate.py to a directory in your $PATH.

Feel free to remove the '.py' extension; Linux doesn't use or need it. Also, remember to make the program executable:

chmod +x autorotate.py

(or whatever you choose to name it).

You may have to edit the first line of the autorotate script, if your distro's Python 2 install doesn't include a link to it via the command "python2".

Usage

Start script:

$ python2 /path/to/autorotate.py

Credits

The original geometry detection algorithms were written by Ayko Poel. My contribution consists of more robust device and device driver identification algorithms for the stylus and eraser, and a general modernization of the transform algorithm.