Thread (8 messages) 8 messages, 4 authors, 2016-02-15

uinput: How to use force feedback?

From: Manuel Reimer <hidden>
Date: 2016-01-17 13:27:44

Hello,

I have an existing uinput driver, which itself sits on an open device 
with a blocking read(), waiting for events to come in. Every event is 
translated to a key code and then sent to uinput.

My next step would be to pass through force feedback information, but I 
don't really understand how I should do this.

As far as I can see, the "uninput device" itself sends events in this 
case. But my main loop is already blocked by the "read", I use to get 
device events.

I see two possible solutions:
- "Somehow", I should be able to get "blocking read" from two open 
devices. As far as I found out, so far, "select" should be the right 
command to do this?
- I could start two threads. One blocked by the "device events" and one 
by the "uinput events".

Which one would you recommend? Is uinput/ioctl thread safe? Is the 
second thread a good idea or is the communication, coming from uinput, 
such "low traffic", that it doesn't delay key handling in a relevant way?

Thank you very much in advance

Manuel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help