[June 25] Stock Android 8.1 ROCK64 | [June 19] Armbian (5.42) ROCK64 | [June 19] Armbian (5.38) PINE A64(+) / PINE A64-LTS / SOPINE | [June 19] motionEyeOS (20180224) PINE A64(+) | [June 19] Armbian (5.46) Pinebook | [June 06] Bionic LXDE (0.6.44-239) ROCK64 | Bionic Minimal (0.6.44-239) ROCK64 | [June 06] Debian Stretch Minimal (0.6.44-239) ROCK64 | [June 06] Jessie OpenMediaVault (0.6.44-239) ROCK64

Project Inspiration | Get Started | IRC Logs | Forum Rules/Policy

Proof of concept script to disable the touchpad while typing
I've just quickly made the following script for python, only tested with python3, on the stock Mate pinebook install.
Not sure if other installs move around the xinput device for the touchpad (else replace the 8 with the right number)

This script disables the touchpad of the pinebook for 0.5 second whenever a key is pressed, any key, including ctrl/shift/alt/mod.  So it's not perfect and cannot be use for shift/ctrl+click very effectively yet. But the script could be modified for that.

Note that if you google for the touchpad problem, you will find a lot of mentions for "syndaemon", which doesn't work (and exits without a message) The "synclient" command however will tell you why, because our touchpad isn't showing up as a touchpad but as an emulated mouse.
Hench this hacky script.

And I've just typed this post without a single problem while the script is running. Figured I share this ASAP, as the very sensitive touch pad is at the top of the list of things that people find annoying.

import threading
import time
import os

class TouchpadHack:
    def __init__(self):
        self.__disabled = False
        self.__condition = threading.Condition()
        self.__disabled_until_time = time.monotonic()
    def timeoutThread(self):
        while True:
            with self.__condition:
            os.system("xinput disable 8")
            while time.monotonic() < self.__disabled_until_time:
                time.sleep(self.__disabled_until_time - time.monotonic())
            os.system("xinput enable 8")

    def inputReadThread(self):
        f = open("/dev/input/event2", "rb")
        while True:
            # We read events here from the keyboard and then just ignore them.
            # The only thing we care about is that an event happens.
            event = f.read(100)
            with self.__condition:
                self.__disabled_until_time = time.monotonic() + 0.5


Messages In This Thread
Proof of concept script to disable the touchpad while typing - by daid - 08-13-2017, 02:06 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Disable touchpad tap to click? colin.faulkingham 15 1,063 08-04-2017, 09:36 PM
Last Post: MarkHaysHarris777
Sad touchpad edges scrolling kurai021 11 687 07-09-2017, 05:56 PM
Last Post: Luke

Forum Jump:

Users browsing this thread: 1 Guest(s)