evdev, mousemove, multitouch auf Raspberry

OP #4834071
Lesenswert?

Hallo Zusammen,

nachdem ich durch eure Hilfe im Thread: 
Beitrag "X11, xlib, multi touch simulation" die Installation von 
"evdev" fertig habe (ausser den Schritt mit "Specifying header 
locations"), möchte ich zuerst versuchen mit "evdev" den Mauszeiger zu 
bewegen,

unten mein Code:

******************************************
#!/usr/bin/env python

from evdev import UInput, AbsInfo, ecodes as e

cap = {e.EV_KEY : [e.KEY_A, e.KEY_B],e.EV_ABS : [(e.ABS_X, 
AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0, 
resolution=0)),(e.ABS_Y, AbsInfo(0, 0, 255, 0, 0, 
0)),(e.ABS_MT_POSITION_X, (0, 255, 128, 0)) ]}

ui = UInput(cap, name=example-device, version=0x3)
#print(ui)
#name "example-device", bus "BUS_USB", vendor "0001", product "0001", 
version "0003"
#event types: EV_KEY EV_ABS EV_SYN

#print(ui.capabilities())
#{0: [0, 1, 3],
#1: [30, 48],
#3: [(0,  AbsInfo(value=0, min=0, max=0,   fuzz=255, flat=0, 
resolution=0)),
#    (1,  AbsInfo(value=0, min=0, max=0,   fuzz=255, flat=0, 
resolution=0)),
#    (53, AbsInfo(value=0, min=0, max=255, fuzz=128, flat=0, 
resolution=0))]}

# move mouse cursor
ui.write(e.EV_ABS, e.ABS_X, 20)
ui.write(e.EV_ABS, e.ABS_Y, 20)
ui.syn()
******************************************


Ich erhalte den Fehler:

******************************************
pi@raspberrypi:~ $ sudo chmod +0666 /dev/uinput
pi@raspberrypi:~ $ python test.py
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    ui = UInput(cap, name=example-device, version=0x3)
NameError: name 'example' is not defined
******************************************


was gibt es da für Namen? Gibt es eine Liste?

Danke
OP #4835078
Lesenswert?

kann mir niemand helfen? Hier mal schritt für schritt wie ich es in der 
Kommandozeile eingebe:

pi@raspberrypi:~ $ sudo chmod +0666 /dev/uinput
pi@raspberrypi:~ $ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import evdev
>>> from evdev import UInput, AbsInfo, ecodes as e
>>> cap = {e.EV_KEY : [e.KEY_A, e.KEY_B],e.EV_ABS : [(e.ABS_X,
... AbsInfo(value=0, min=0, max=255, fuzz=0, flat=0,
... resolution=0)),(e.ABS_Y, AbsInfo(0, 0, 255, 0, 0,
... 0)),(e.ABS_MT_POSITION_X, (0, 255, 128, 0)) ]}
>>> ui = UInput(cap, name='example-device', version=0x3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/evdev/uinput.py", line 
136, in _init_
    _uinput.create(self.fd, name, vendor, product, version, bustype, 
absinfo)
IOError: [Errno 22] Invalid argument



was ist hier invalid???

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren