Monday, June 6, 2016


For touchscreen I used Python code from https://github.com/derekhe/waveshare-7inch-touchscreen-driver to make it work with Privacy Enhanced Linux. If you look at his install.sh script there's a line commented out for pip3 which is what I use. You can sudo each step manually to make sure it goes OK. After installation I found I couldn't get the hidden panel to pop up -- the touchscreen overlay is actually 400x240, half the screen's res, and it doesn't go all way to the edge --  so a little driver hacking was in order. You only need to change two lines in /usr/bin/touch.py to subtract four pixels from X and Y axis coordinates before passing them on to the mouse emulator:

device.emit(uinput.ABS_X, x - 4, True)
device.emit(uinput.ABS_Y, y - 4, True)

I also decided to do the third button emulation through evdev by editing the touchscreen catchall in /usr/share/X11/xorg.conf.d/10-evdev.conf and adding:

Option "EmulateThirdButton" "1"
Option "EmulateThirdButtonTimeout" "750"
Option "EmulateThirdButtonMoveThreshold" "60"

"man evdev" for more info... the code author sells a "pro" version which does even more than that, though.

Lastly, I found xvkbd to be the most compatible on-screen keyboard given the Pi's terrible graphics (no fancy transparency effects) but the installer sux and I had to make a launcher for it. If you click the window manger control in upper left corner you'll find a "Always on Top" option for the keyboard.









Well, that's it then I guess.. you might want to uninstall progs that capture the mouse like tecnoballz as there's no way out of them with a touchscreen. The pre-installed Raleigh style turns sliders into buttons which also works well with my touchscreen... so remember, when all looks lost and hopeless, USE THE SOURCE LUKE! You can't do that with Microsloth Winblows. :P