On Wed, Feb 24, 2010 at 10:53 PM, Peter Hutterer
<[email protected]> wrote:
> On Wed, Feb 24, 2010 at 10:40:16PM -0800, Ping Cheng wrote:
>> Acked-by:  Ping Cheng  <[email protected]>
>>
>> Both the attached patch below and the man page patch of this thread
>> look good to me. I know my comment below is outside of the two patches
>> that we are talking about, I'd still like to bring it up one more time
>> so someone may fix the issue in the server.
>>
>> With the following line:
>>
>> > +       nbbuttons = (nbbuttons > 3) ? nbbuttons + 4 : 7;
>>
>> we will not be able to send a button event larger than 7 for a device
>> has less than 4 buttons and nbbuttons + 4 for a device has less than
>> nbbuttons+1 buttons.  This is not "nice".  I think the X server needs
>> to have a separate entity to store the maximum number of server
>> supported button events. The number of physical buttons of a device
>> supports has nothing to do with which button events the physical
>> button can post.
>
> yes, you are right, it even says in the protocol spec that logical buttons
> "are not restricted in value by the number of physical buttons, but no two
> elements can have the same nonzero value" (SetPointerMapping)
> however, this affects the _logical_ button mapping, not the physical button
> mapping. in the driver we do not have access to the former (only during
> initialization time).
> any wacom-internal button mapping makes the mapped button appear as if it
> was a different physical button. hence the limitation applies.
>
> e.g. a _wacom_ button mapping of 1:3 makes button 1 appear as physical
> button 3. Neither server nor client know that it's in fact button 1 that was
> pressed. With the same _logical_ map (XSetPointerMapping), the clients can
> still query the map and then know that if a button 3 event arrives, it was
> likely button 1 that was pressed (likely, not guaranteed on server
> supporting XI 1.5 or later).


I don't think server or client needs to know which physical button is
pressed.  Server only cares which logical button event needs to be
posted and client only cares which logical button event has been
received. It is up to the end users or the application to map a
physical button to a logical  button through "xinput --set-button-map"
or "xsetwacom set" and keep track of the button mappings.


> I just tried this on my sever here and it worked fine:
>
> :: w...@barra:~> xinput --set-button-map "Wacom Intuos4 6x9" 20 21 22
> :: w...@barra:~> xinput --get-button-map "Wacom Intuos4 6x9"
> 20 21 22 4 5 6 7 8 9 10 11

If number of physical buttons does not affect the logical button event
we send, what's the purpose of buttons and butmap in
InitButtonClassDeviceStruct(local->dev, num_buttons, butmap)? Do we
suppose to initialize the ButtonClassDeviceStruct again each time when
we change the button mapping?  With your testing result above, it
looks like we don't need to.

I am still confused.  But I am willing to move on since it works anyway.

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