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)

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

If you're not sure about the file name format, learn more about wheel file names.

libpointing-1.1.4-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file libpointing-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: libpointing-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for libpointing-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1be8545cf292fdf555bfb21d62cc34e4ee13ac026967eb99cf151854d2ff4547
MD5 4447f20ae6303d96035f09368ef7e7ef
BLAKE2b-256 15812ad55d109ff8c028b84409c1aa1a6eca107ee7239d42a41b5fc4002a4435

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page