Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tito/python-mtdev
Python binding for mtdev
https://github.com/tito/python-mtdev
Last synced: 1 day ago
JSON representation
Python binding for mtdev
- Host: GitHub
- URL: https://github.com/tito/python-mtdev
- Owner: tito
- License: other
- Created: 2010-08-24T09:04:34.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-09-04T22:18:39.000Z (about 14 years ago)
- Last Synced: 2024-09-23T11:07:13.545Z (10 days ago)
- Language: Python
- Homepage:
- Size: 175 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
python-mtdev
============Python binding for mtdev.
Project mtdev is available at https://launchpad.net/mtdevInstallation
------------python setup.py install
Test with a multitouch device
-----------------------------python -m mtdev /dev/input/eventX
Usage
-----Example of code ::
slot = 0
filename = '/dev/input/event3'# open the device
dev = mtdev.Device(sys.argv[1])while True:
# if no activity, sleep :)
if dev.idle(1000):
continue# read all available data
while True
data = dev.get()
if data is None:
break# change the slot number
if data.type == mtdev.MTDEV_TYPE_EV_ABS and \
data.code == mtdev.MTDEV_CODE_SLOT:
slot = data.value# print data
print dict(slot=slot, code=hex(data.code), \
type=data.type, value=data.value)