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 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 
:: w...@barra:~> xev | grep -A 4 ButtonPress
ButtonPress event, serial 30, synthetic NO, window 0x4e00001,
    root 0x151, subw 0x0, time 206854523, (121,153), root:(1570,222),
    state 0x10, button 20, same_screen YES

MotionNotify event, serial 30, synthetic NO, window 0x4e00001,
--
ButtonPress event, serial 30, synthetic NO, window 0x4e00001,
    root 0x151, subw 0x0, time 206855615, (124,144), root:(1573,213),
    state 0x10, button 20, same_screen YES

MotionNotify event, serial 30, synthetic NO, window 0x4e00001,
--
ButtonPress event, serial 30, synthetic NO, window 0x4e00001,
    root 0x151, subw 0x0, time 206856195, (131,141), root:(1580,210),
    state 0x10, button 20, same_screen YES

MotionNotify event, serial 30, synthetic NO, window 0x4e00001,

Cheers,
  Peter

------------------------------------------------------------------------------
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