Skip to main content

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)

Metadata

Release files for libpointing 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for libpointing 1.2.0
File Interpreter ABI Platform
libpointing-1.2.0-py3-none-any.whl Python 3 none any Details

Release files / libpointing-1.2.0-py3-none-any.whl

Download URL libpointing-1.2.0-py3-none-any.whl
Size 6.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9cc6910537a8b3d5902b9c1589be219b8e524602d36c444b404f3fafdea440ef
BLAKE2b-256 checksum
How to use checksums
05f1a7d26b5dd2ace957138a7bb7f6d7bf09d0de78d4d844f27036383f87f74a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

2 release files

1.0.8.5

1 release file

1.0.8.4

1 release file

1.0.8.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page