Hi Jason,

Jason Gerecke said the following on 10/09/2012 08:36 PM:
> INPUT_PROP_* aren't bit flags -- they're bit positions. That is, if
> bit number INPUT_PROP_DIRECT is set, then it's a direct input device.
> Or, put differently (and grabbing descriptions from event-codes.txt):
>
> if (flag&  (1<<  INPUT_PROP_POINTER)) {
> // The INPUT_PROP_POINTER property indicates that the device is not transposed
> // on the screen and thus requires use of an on-screen pointer to trace user's
> // movements.  Typical pointer devices: touchpads, tablets, mice; non-pointer
> // device: touchscreen.
> }
> if (flag&  (1<<  INPUT_PROP_DIRECT)) {
> // The INPUT_PROP_DIRECT property indicates that device coordinates should be
> // directly mapped to screen coordinates (not taking into account trivial
> // transformations, such as scaling, flipping and rotating). Non-direct input
> // devices require non-trivial transformation, such as absolute to relative
> // transformation for touchpads. Typical direct input devices: touchscreens,
> // drawing tablets; non-direct devices: touchpads, mice.
> }
>
> Note that INPUT_PROP_DIRECT is specified to be set for both
> touchscreens (e.g. Cintiq, tablet PC) *and* for drawing tablets (e.g.
> Intuos, Bamboo). To properly ensure that you're getting a touchscreen,
> you need to make sure that its DIRECT and non-POINTER. Because of
> this, the libwacom code technically isn't correct; the only reason it
> doesn't think an Intuos is built-in is because the guidelines weren't
> clear when my kernel patches were accepted and so they don't have the
> DIRECT flag set.
>
> To be correct and use the defines instead of hex codes, it should
> probably be written more like:
>
> int hw_flags = atoi(contents);
> int direct_flag = (1<<  INPUT_PROP_DIRECT);
> int pointer_flag = (1<<  INPUT_PROP_POINTER);
>
> *builtin = (hw_flags&  (direct_flag | pointer_flag) == direct_flag) ?
> IS_BUILTIN_TRUE : IS_BUILTIN_FALSE;

Thanks for the clarification, I'll update the patches with this fix as 
well.

Cheers,
Olivier.


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to