Thread (7 messages) 7 messages, 3 authors, 2017-02-03

Re: uinput really needs a custom sleep time?

From: Peter Hutterer <hidden>
Date: 2017-02-03 02:59:37

On Fri, Feb 03, 2017 at 12:20:19AM -0200, Marcos Paulo de Souza wrote:
On Fri, Feb 03, 2017 at 08:19:16AM +1000, Peter Hutterer wrote:
quoted
On Tue, Jan 31, 2017 at 12:00:40AM -0200, Marcos Paulo de Souza wrote:
quoted
Hi input guys,

after playing with uinput, it seems an sleep call is necessary before
emitting new events. If this really required?

While reading code of cwiid project, another user of uinput interface, it
seems this sleep time isn't necessary[1].

In the other hang, when trying to send a simple event in my desktop, an
sleep is necessary, take a look in my example[2].

Another interesting fact: kernel documentation lacks of an uinput example.
Do you think this would be interesting to have one?
I'm obviously biased but imo you should really use libevdev for uinput
devices, it makes things a lot easier. Example is here:
https://www.freedesktop.org/software/libevdev/doc/latest/group__uinput.html

it also makes any sleep calls obsolete because it won't return until the
device node is available.
I created another example[1], basically converting my uinput code now using
libevdev, but it doesn't work as it should...

Am I missing something, or forgetting to set some bit?
you're missing a SYN_REPORT after the key down.

Cheers,
   Peter
Thanks.

[1]
https://github.com/marcosps/kernel_experiments/blob/master/userspace/evdev.c
quoted
Cheers,
   Peter
quoted
Thanks for your time,
Marcos

[1] https://github.com/abstrakraft/cwiid/blob/master/wminput/uinput.c#L193
[2] https://github.com/marcosps/kernel_experiments/blob/master/userspace/uinput.c#L65
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help