# Python binding for libpointing library
```
pip install libpointing
```
Visit [libpointing.org](https://libpointing.org) to know more about the library and the [Python binding](https://github.com/INRIA/libpointing/tree/master/bindings/Python/cython)
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)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "libpointing",
"maintainer": null,
"docs_url": null,
"requires_python": "==3.12.*",
"maintainer_email": "G\u00e9ry Casiez <gery.casiez@univ-lille.fr>",
"keywords": "mouse, hid, pointing, input, device, transfer function, subpixel, raw-input",
"author": "Izzatbek Mukhanov",
"author_email": "Nicolas Roussel <nicolas.roussel@inria.fr>, G\u00e9ry Casiez <gery.casiez@univ-lille.fr>",
"download_url": null,
"platform": null,
"description": "# Python binding for libpointing library\n\n```\npip install libpointing\n```\n\nVisit [libpointing.org](https://libpointing.org) to know more about the library and the [Python binding](https://github.com/INRIA/libpointing/tree/master/bindings/Python/cython)\n\nHere is a minimal example:\n\n```\nfrom libpointing import PointingDevice, DisplayDevice, TransferFunction\nfrom libpointing import PointingDeviceManager, PointingDeviceDescriptor\n\nimport sys\n\ndef cb_man(desc, wasAdded):\n\tprint(desc)\n\tprint(\"was added\" if wasAdded else \"was removed\")\n\n\npm = PointingDeviceManager()\nPointingDevice.idle(100)\npm.addDeviceUpdateCallback(cb_man)\n\nfor desc in pm:\n\tprint(desc)\n\n\"\"\"\nfor desc in pm:\n\tprint desc.devURI\n\tprint desc.vendor, desc.product\n\tpdev = PointingDevice(desc.uri)\n\"\"\"\n\npdev = PointingDevice(b\"any:\")\nddev = DisplayDevice.create(\"any:\")\ntfct = TransferFunction(b\"system:\", pdev, ddev)\n\ndef cb_fct(timestamp, dx, dy, button):\n rx,ry=tfct.applyd(dx, dy, timestamp)\n print(\"%s: %d %d %d -> %.2f %.2f\"%(str(timestamp), dx, dy, button, rx, ry ))\n sys.stdout.flush()\n\npdev.setCallback(cb_fct)\nprint(\"Move the mouse of Press CTRL+C to exit\")\nfor i in range(0, 10000):\n PointingDevice.idle(1)\n```\n",
"bugtrack_url": null,
"license": "GPLv2",
"summary": "Python binding for libpointing.",
"version": "1.1.1",
"project_urls": {
"homepage": "https://libpointing.org"
},
"split_keywords": [
"mouse",
" hid",
" pointing",
" input",
" device",
" transfer function",
" subpixel",
" raw-input"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3f81d11008709493452c8b7eacd93ac720a6382e055be2f9b4e3d842ed123ec3",
"md5": "38c6d4d9406fc076c3e9970506f31ada",
"sha256": "2825c3adc469a6b4508d0df8cc6b0e6072ad7bdf02f111cdb740ebf2514543d1"
},
"downloads": -1,
"filename": "libpointing-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "38c6d4d9406fc076c3e9970506f31ada",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "==3.12.*",
"size": 1187550,
"upload_time": "2024-12-14T18:41:19",
"upload_time_iso_8601": "2024-12-14T18:41:19.590280Z",
"url": "https://files.pythonhosted.org/packages/3f/81/d11008709493452c8b7eacd93ac720a6382e055be2f9b4e3d842ed123ec3/libpointing-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-14 18:41:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "libpointing"
}