On Thu, Feb 18, 2010 at 8:53 PM, Chris Bagwell <[email protected]> wrote:
> Good.  I get to knock out two items at once: A code review and a
> question on porting a linuxwacom change.
>
> In your description you say add 4 when more then 3 buttons.  So should
> "(nbbuttons > 4)" really be "(nbbuttons >= 4)" (or > 3)?
>
> linuxwacom-0.8.5-10 had related patch.  Its math looks buggy if there
> is such a thing as a tablet with 0, 1, or 2 buttons.

There are cases of 0 (all older tablets don't have any buttons) and 2
(graphire 4 has 2 buttons and 1 wheel) buttons.  If you don't let them
fall to 7, you still can not send button 6 and 7 events for Graphire
4.  Also, all tools are counted into this case not just tablet buttons
(pad in our term). Eraser has one button, stylus usually has 3
(sometime 2), and cursor normally has 3 or 5.  We didn't go this far
to specify them in such a detail.....

>
>        /* support at least 7 buttons */
>        num_buttons = nbbuttons - 3 ? (7 + (nbbuttons - 3)) : 7;
>
>        if (InitButtonClassDeviceStruct(local->dev, num_buttons,
> butmap) == FALSE)
>
> Fixing to 7 buttons for 3 button case seems a little odd unless pads
> with <= 3 buttons can support touch gesture and we need to always
> reserve those 4-7 buttons to support scroll gesture (which uses
> buttonUp/buttonDown).

Tablet buttons (pad) and tool buttons (stylus/cursor/eraser) are
allowed to assign to any button events and keystrokes, which include
button 6 and 7 events.  I think there should be a fix in the X server
to support all physical buttons regardless how many physical buttons a
device has. That would fix this kind of "hacking" in the driver from
its root. IMO, the number of physical buttons and the number of
logical buttons the server can support are irrelevant (well, to some
extent).

Ping

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to