Simulate multi-touch scrolling using uinput
Project description
touchscroller
Simulate smooth multi-touch scrolling on Linux with uinput.
On many Linuxes you can only scroll instantly over several lines. This package lets you script pixel-level scrolling by simulating two fingers on a touchpad.
Setup
pip install touchscroller
You must have the uinput kernel module loaded to use touchscroller. Two options:
- Quickly start it for now:
modprobe -i uinput
- Auto load on start up:
echo uinput | sudo tee /etc/modules-load.d/uinput.conf > /dev/null
You also need permissions to create a uinput device. Three options:
- Quickly run as root:
sudo python myscript.py
- Temporary fix until reboot:
sudo chmod 666 /dev/uinput
- Proper, most annoyingly involved way:
# create a udev rule
echo 'KERNEL=="uinput", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-uinput.rules > /dev/null
# add current user to 'input' group
sudo usermod -aG input "$USER"
# reload udev rules and trigger
sudo udevadm control --reload-rules
sudo udevadm trigger
echo 'all done, now reboot or log out and back in'
Usage:
from touchscroller import TouchScroller
ts = TouchScroller()
directions = [
(3, 0), (2, 2), (0, 3), (-2, 2),
(-3, 0), (-2, -2), (0, -3), (2, -2)
]
ts = TouchScroller()
with ts.touch() as touch:
for dx, dy in directions:
for _ in range(30):
touch.move(dx, dy)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file touchscroller-0.1.1.tar.gz.
File metadata
- Download URL: touchscroller-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ccb384b9e0c7eaccf6c2964517fb4ded25110c5176508f5995d505732e1d70
|
|
| MD5 |
da5d65ceb9a681063da7d5b7c169541f
|
|
| BLAKE2b-256 |
50714cb394810fbfb2c2933e446339153dad2fb33c30b17bcb56565f4271a801
|
File details
Details for the file touchscroller-0.1.1-py3-none-any.whl.
File metadata
- Download URL: touchscroller-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c192985aae584894d7c618fa32cff79c66de6346077c6742a6873989681a4413
|
|
| MD5 |
28ec363267bd6da9685000f6dd8ab576
|
|
| BLAKE2b-256 |
f3ad4da619abee54b4fb5a62f69a8013892d71b858b5d1d8232084d830655cbf
|