On Sat, Jan 10, 2009 at 3:56 PM, Pierre Willenbrock <pierre at pirsoft.dnsalias.org> wrote: > m. allan noah schrieb: >> On Sat, Jan 10, 2009 at 2:55 PM, Pierre Willenbrock >> <pierre at pirsoft.dnsalias.org> wrote: >>> m. allan noah schrieb: >>>> On Sat, Jan 10, 2009 at 1:11 PM, Pierre Willenbrock >>>> <pierre at pirsoft.dnsalias.org> wrote: >>>>> m. allan noah schrieb: >>>>>> On Fri, Jan 9, 2009 at 5:02 PM, Pierre Willenbrock >>>>>> <pierre at pirsoft.dnsalias.org> wrote: >>>>> [...] >>>>>>> Another question: Is it okay to only look at the hardware state if the >>>>>>> frontend asks for the state of the option? That way shorter presses can >>>>>>> be lost, if the frontend does not poll often enough. >>>>>> In my case, the scanners are smart enough to buffer the button presses >>>>>> for 3 seconds, and I effectively read the status of all the buttons >>>>>> from the scanner every time you ask for the value of the first option. >>>>>> So, as long as the front-end reads within that 3 second window, no >>>>>> presses are lost. >>>>>> >>>>>> If your machines dont buffer, then you might need a thread just to >>>>>> read the status really quickly? Do you know how frequently the windows >>>>>> driver reads the buttons? >>>>> The genesys chips don't help at detecting hardware buttons. The only >>>>> sensor logic in the chip is for the home-sensor. The rest is GPIO. >>>> Is it possible for a user to press and release the button and have the >>>> driver 'lose' it if you dont read the GPIO pins during the 'pressed' >>>> inteval? >>> Exactly like that. And the windows driver has the same problem. >> >> Ahh, I love cheap scanners :) How fast would you have to poll the >> scanner to get short presses? 10Hz? > > In my exerience, at 10Hz it is hard to press short enough for the press > to not get noticed. 2Hz is too slow, 8Hz is okay, and above 12Hz it is > impossible to lose presses, even when hammering the button like mad. At > least, you cannot be sure if the software lost the press or you didn't > press the button properly. > > The shortest single presses i managed were 20ms, averaging at 40ms. > Normal presses are 70-110ms. Now one could calculate the odds for a > missed button press, but i will not go there.
I would expect those numbers to be similar to other "unbuffered" scanners, so lets just say that the front-end should loop over the values of the buttons at 10Hz. It is alot easier for the frontend to read more frequently than for backends to add threads/IPC. And, if reading the button status is a heavy weight operation, the backend could return cached data occasionally. allan -- "The truth is an offense, but not a sin"