On Wed, Mar 23, 2011 at 12:58:21PM -0700, Jason Gerecke wrote:
> As I'm working on the X11 wheel mapping, I'm finding a few weird
> quirks in the code. I pretty much understand 'how' things work, but
> I'm not sure why some things are the way they are...
> 
> 1. Why does WACOM_PROP_BUTTON_ACTIONS have room for only 16 buttons,
> yet priv->btn_actions (storing the same data) have space for 32? The
> functional difference between WCM_MAX_BUTTONS and
> WCM_MAX_MOUSE_BUTTONS is not clear.

7d149431c63c43c0ab5b046387b565488ea3d159 has some explanation what
WCM_MAX_BUTTONS is, but I can't remember any more details.
They were introduced in 2debfce6f9d6bfb206da2e1711d04f42cddd71e1, but
the comments in that commit don't really clarify things for me.

> 2. Why maintain a seperate raw button codepath when the "actions"
> codepath already does the same thing when given a 'button' action?

simplicity mainly (and the raw path was there before). note that the button
action can be combined with a key action, so "key +ctrl button 1 key -ctrl"
is a valid action.

> 3. Why does xsetwacom take X11 buttons as the first argument to
> "Button X"? I can't be alone in thinking it was weird my cintiq was
> missing two buttons (6 & 7) and that two other buttons (4 & 5) only
> responded to changes via the Strip(Left|Right)(Up|Down) command.

This should be documented better. Button mapping in X is complicated to say
the least. http://who-t.blogspot.com/2009/06/button-mapping-in-x.html

xsetwacom takes x11 buttons because for simple button mappings, it uses
XSetDeviceButtonMappings (which requires X buttons).
X buttons have the advantage of being easy to debug (for users). A
driver-internal button mapping is private to the driver and hard to figure
out at the best of times. e.g. which button on your device is Button 1?
running xev or xinput will only tell you the logical button 1, not the
physical button 1.

Cheers,
  Peter

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to