linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
To: Peter Hutterer <peter.hutterer@who-t.net>
Cc: linux-input@vger.kernel.org
Subject: Re: uinput really needs a custom sleep time?
Date: Fri, 3 Feb 2017 00:20:19 -0200	[thread overview]
Message-ID: <20170203022018.GB29638@xfiles> (raw)
In-Reply-To: <20170202221916.GB23446@jelly>

On Fri, Feb 03, 2017 at 08:19:16AM +1000, Peter Hutterer wrote:
> On Tue, Jan 31, 2017 at 12:00:40AM -0200, Marcos Paulo de Souza wrote:
> > 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?

Thanks.

[1]
https://github.com/marcosps/kernel_experiments/blob/master/userspace/evdev.c

> 
> Cheers,
>    Peter
> 
> > 
> > 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
> > 

  parent reply	other threads:[~2017-02-03  2:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31  2:00 uinput really needs a custom sleep time? Marcos Paulo de Souza
2017-01-31  2:21 ` Dmitry Torokhov
2017-02-01  1:11   ` Marcos Paulo de Souza
2017-02-02 22:19 ` Peter Hutterer
2017-02-03  0:56   ` Marcos Paulo de Souza
2017-02-03  2:20   ` Marcos Paulo de Souza [this message]
2017-02-03  2:59     ` Peter Hutterer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170203022018.GB29638@xfiles \
    --to=marcos.souza.org@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).