Elf M. Sternberg
||2 years ago|
|docs||2 years ago|
|studies||2 years ago|
|vendor||2 years ago|
|xcb_read||2 years ago|
|xcb_read_rs||2 years ago|
|.clang-format||2 years ago|
|.gitignore||2 years ago|
|.gitmodules||2 years ago|
|LICENSE.md||2 years ago|
|Makefile||2 years ago|
|README.md||2 years ago|
|notes.md||2 years ago|
This is a re-write of my Surface Pro 3 Autorotate program. Note that what you have here is just part of the learning curve.
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.
The intent of this exercise is to eventually
code. Right now, I'm actively learning how the X11/XCB library works
to encode and transmit monitor and rotation information for the root
screen, so what you'll find in the
src tree is a C++
program where I'm slowly, one painful step at a time, figuring out how
to efficiently retrieve information from the X11 server and then send
commands to rotate the screen.
My only observation so far is that, after having a run in with
std::unique_ptr, the ergonomics of Rust make me very happy indeed.
I can only hope the Rust/XCB interface adheres close enough to the C
version that the port is trivial.
The original geometry detection algorithms that this script will use 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.
This code has been tested with gcc-7.3, and should work on any C++17-compliant compiler with the relevant standard library, and obviously X Windows.
From the base directory of the project (not that there's much there):
$ mkdir build $ cd build $ cmake .. $ make
This XRandR experiment is Copyright Elf M. Sternberg (c) 2019, and licensed with the Mozilla Public License vers. 2.0. A copy of the license file is included in the root folder.
Code of Conduct
Don't be a douchebag. That is all.