lkml.org 
[lkml]   [2011]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: select() on /dev/input/eventX not level-triggered?
On Mon 2011-05-23 13:49:10, Dmitry Torokhov wrote:
> On Mon, May 23, 2011 at 10:06:22PM +0200, Pavel Machek wrote:
> > On Mon 2011-05-23 11:13:12, Dmitry Torokhov wrote:
> > > On Fri, May 20, 2011 at 01:50:51AM +0200, Pavel Machek wrote:
> > Difference was I'm not using non-blocking read().
>
> Does not matter.
>
> > It is unusual but
> > should work AFAICT. Just read one packet when select shows its ready;
> > if there's more than one, don't loop around read, but rely on select
> > returning immediately.
> >
> > I did verify it on strace, so it should not be python artefact.
>
> It is artefact of your program, you buffering your input. Use:
>
> file = open("/dev/input/event3", "rb", 0)

Oops, yes, you are right, that solves it. Thanks... and sorry for the
noise.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2011-05-23 23:23    [W:0.025 / U:5.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site