On Mon, Mar 10, 2014 at 05:58:45PM -0700, Jason Gerecke wrote:
> 
> I agree that what we currently have isn't perfect either. Short of
> throwing out what we have (which is essentially what the second patch
> does :D), our only option is to improve the current code. While this
> patch is one step forward for one corner case, its one step backwards
> for another equally-likely one.
> 
> That said, I'm interested in seeing what you come up with to work
> around the worn-pen issue. As a note, as you work on this, you might
> consider storing the data in the 'tool' structure rather than 'priv'.
> At the moment there's not much benefit to this, but with a little
> work, it would easily allow per-serial accounting of pen wear.
> 

I've been thinking about per-serial accounting of pen wear.
There are three reasons why I don't want to go this route:
1. The tool structure is per serial only when explicitely configured
   for the device. In the future we may allocate a tool structure for
   each serial we encounter - even if it's not configured. So this
   could be fixed.
2. For a yet unknown pen we'd have to 'learn' the pressure bias.
   We'd either use initial pressure we see when the pen is first
   introduced as the initial bias and work our way down (*) or we assume
   0 and work our way up which would require some statistics over
   serval proximity events to avoid being caught by the same problem.
3. A simple approach would not be able to take care of gradually
   increasing wear.

(*) This would actually be a common scenario on my specific use case
thus it would not help there at all.

I therefore changed the algorithm slightly to trigger only under very
specific circumstances:
1. If a button event was triggered 'normally' don't bother checking
   for one triggered thru maxRawPressure.
2. Release a button when triggered thru the alternative mechanism once
   minPressure doesn't decrease any more.
This narrows down the cases it covers but it should (and according
to my tests it does) still cover the more realistic ones.
I will continue testing I make a new proposal.

Cheers,
        Egbert.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to