m. allan noah schrieb: > On Wed, Jan 7, 2009 at 1:09 PM, Pierre Willenbrock > <pierre at pirsoft.dnsalias.org> wrote: [...] >> >> I have no experience with the sane interface itself, so comments/patches >> are gladly accepted. > > We have settled on exposing buttons via options with: > opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; > > Then the frontend should poll such options occasionally to collect > presses. If all buttons are read in one command, the backend should > take care to only call it in a way that will not lose button presses. > The fujitsu backend does this by maintaining two booleans for each > button, one of the value last read from the scanner, and one stating > if it has been read by the frontend yet. When the frontend asks for a > button a second time, i get all the values and cache them. >
So, the boolean value of the option represents the current state of the button, which is TRUE if the button was down anytime since the last time the frontend looked? Or is it additionally FALSE, if the option was TRUE when read last time, and the button up anytime since then? 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. Before i start to ask more similar questions: Is this documented somewhere? I looked at the html-version of the standard, but could only find the capabilities thing for buttons. Regards, Pierre