Python binding for libpointing.
Project description
Python binding for libpointing library
pip install libpointing
Visit libpointing.org to know more about the library and the Python binding
Here is a minimal example:
from libpointing import PointingDevice, DisplayDevice, TransferFunction
from libpointing import PointingDeviceManager, PointingDeviceDescriptor
import sys
def cb_man(desc, wasAdded):
print(desc)
print("was added" if wasAdded else "was removed")
pm = PointingDeviceManager()
PointingDevice.idle(100)
pm.addDeviceUpdateCallback(cb_man)
for desc in pm:
print(desc)
"""
for desc in pm:
print desc.devURI
print desc.vendor, desc.product
pdev = PointingDevice(desc.uri)
"""
pdev = PointingDevice(b"any:")
ddev = DisplayDevice.create("any:")
tfct = TransferFunction(b"system:", pdev, ddev)
def cb_fct(timestamp, dx, dy, button):
rx,ry=tfct.applyd(dx, dy, timestamp)
print("%s: %d %d %d -> %.2f %.2f"%(str(timestamp), dx, dy, button, rx, ry ))
sys.stdout.flush()
pdev.setCallback(cb_fct)
print("Move the mouse of Press CTRL+C to exit")
for i in range(0, 10000):
PointingDevice.idle(1)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file libpointing-1.0.8.5-py3-none-any.whl
.
File metadata
- Download URL: libpointing-1.0.8.5-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3986494d220013a2ccce44f2561597b18d8934a62ef01f9bb0436d6cfea3277c |
|
MD5 | 12e215cff21cee7f9e915ed90432b61a |
|
BLAKE2b-256 | 0bf3ab0d92ab768fa5c7ae9296db7c3ecfbe82150cfe95df37219b8cb21467ea |