No attribute uinput.EV_KEY

Asked by Matt DePorter

First off, thanks again for fixing that installation bug in 0.6.1! But, I am still having a problem with the most recent release.

So I have two questions:

I am using ENAC's tuiototouch bridge and it is saying that uinput does not have an attribute for EV_KEY. Here is my output:

Traceback (most recent call last):
  File "tuiototouch.py", line 114, in <module>
    device=DeviceWME()
  File "tuiototouch.py", line 62, in __init__
    Device.__init__(self)
  File "tuiototouch.py", line 16, in __init__
    uinput.EV_KEY: [uinput.BTN_TOUCH],
AttributeError: 'module' object has no attribute 'EV_KEY'

I checked another computer, which is running python-uinput 0.5 and it does have that attribute but 0.6.2 does not. What can I do, or could you add back those attributes?

Second question. I am trying to find a way to do both a middle click and drag, and a right click and drag. What would you suggest doing to make that happen, if it is even possible? If so, what attribute would I use so I could make a custom input for those gestures?

Thanks again guys! Keep up the good work!

-Matt

Question information

Language:
English Edit question
Status:
Answered
For:
python-uinput Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
a (tuomasjjrasanen) said :
#1

Yes. It seems that ENAC's tuiototouch.py is written against the older python-uinput API (pre 0.6 era *). It had few rough edges which I was not satisfied with. One of those edges was the requirement to explicitly state the event type for different event codes (EV_KEY whenever one used KEY_* or BTN_* events). The revised API is much simpler in that sense: one can operate only on predefined event codes and corresponding event types are handled internally.

Unfortunately, ENAC has not yet revised their official tuiototouch.py version [1]. However, I found their Git-tree, forked it and made one commit to update tuiototouch.py to use the newer python-uinput API. If you are willing to experiment with that, check it out: https://github.com/tuomasjjrasanen/tuiototouch . Please note that I have ran only minimal tests and modified it only to match the new python-uinput API. I have not paid any attention to the actual tuio-touch logic.

* ( In my projects, 0.x version numbers mean that they are so called development releases and backwards-incompatible changes should be expected. Withing 1.x releases, I try to keep all changes backwards-compatible at least withing the 1-series. Withing 2.x releases, I try to keep all changes backwards-compatible at least withing the 2-series and so on. )

[1]: http://lii-enac.fr/cgi-bin/gitweb.cgi?p=linux-input/tuiototouch.git;a=summary

Revision history for this message
a (tuomasjjrasanen) said :
#2

Tuomas Jorma Juhani Räsänen suggests this article as an answer to your question:
FAQ #1833: “How to emulate a mouse click + drag?”.

Can you help with this problem?

Provide an answer of your own, or ask Matt DePorter for more information if necessary.

To post a message you must log in.