On Thu, Feb 02, 2012 at 09:32:03AM -0600, Chris Bagwell wrote: > Hi Aristeu, > > I'm sure people will be happy to see this patch. I've a question for you > below. > > On Wed, Feb 1, 2012 at 11:23 AM, Aristeu Rozanski <[email protected]> wrote: > > This patch adds support for the pad buttons and dial in the bluetooth > > version > > of Intuos4. > > > > Signed-off-by: Aristeu Rozanski <[email protected]> > > > > --- > > drivers/hid/hid-wacom.c | 38 ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 38 insertions(+) > > > > --- linus-2.6.orig/drivers/hid/hid-wacom.c 2012-02-01 > > 11:54:09.000000000 -0500 > > +++ linus-2.6/drivers/hid/hid-wacom.c 2012-02-01 12:17:46.166583951 -0500 > > @@ -363,6 +363,35 @@ input_report_key(input, BTN_STYLUS2, d > > return; > > } > > > > +static void wacom_i4_parse_pad_report(struct wacom_data *wdata, > > + struct input_dev *input, unsigned char *data) > > +{ > > + input_report_key(input, BTN_0, (data[2] & 0x01)); > > + input_report_key(input, BTN_1, (data[3] & 0x01)); > > + input_report_key(input, BTN_2, (data[3] & 0x02)); > > + input_report_key(input, BTN_3, (data[3] & 0x04)); > > + input_report_key(input, BTN_4, (data[3] & 0x08)); > > + input_report_key(input, BTN_5, (data[3] & 0x10)); > > + input_report_key(input, BTN_6, (data[3] & 0x20)); > > + input_report_key(input, BTN_7, (data[3] & 0x40)); > > + input_report_key(input, BTN_8, (data[3] & 0x80)); > > + > > + if (data[1] & 0x80) > > + input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f)); > > + else > > + /* Out of proximity, clear wheel value. */ > > + input_report_abs(input, ABS_WHEEL, 0); > > + > > + if (data[1] | (data[2] & 0x01) | data[3]) { > > + input_report_key(input, wdata->tool, 1); > > + input_report_key(input, BTN_TOOL_FINGER, 1); > > + } else { > > + input_report_key(input, wdata->tool, 0); > > + input_report_abs(input, BTN_TOOL_FINGER, 0); > > + } > > I'm assuming your sending BTN_TOOL_FINGER because thats what Intuos4 > does in wacom_wac.c kernel driver? yep.
> For drivers that want to use Protocol 4 or 5 style events (see > http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Kernel_Input_Event_Overview > ), this does inform xf86-input-wacom to treat these as "PAD events" > so, for example, ABS_WHEEL is treated as a wheel on PAD device and not > a wheel on mouse puck or airbrush. but that's intended. it's a wheel on the side of the tablet: === +-----------------------------+ === | | === | | === | | w | | w=w | | w | | === | | === | | === | | === +-----------------------------+ > But Protocol 4and 5 drivers are also required to send a value in > ABS_MISC as described in above link. If not, the serial # is stuck > with fixed value of zero and then the same data structure in > xf86-input-wacom will be used to store all events for all hotplugged > devices. I'm not exactly sure what that would visually result in but > I assume if you leave pen in proximity while you click a tablet button > that the pen would be forced out of proximity when you release the > button. Or maybe jump to location (0,0). > > One option is to update xf86-input-wacom so that driver does not have > to send serial #'s always. Over last year, xf86-input-wacom::wcmUSB.c > has added a function called usbInitToolType() that peeks at all > buffered events to detect tool type. Right now, it only does it to > see which hotplug device type to send events to. We could also change > to decide which data structure/array location (called channel > internally) as well; We could at least do this for the PAD device > which is always force to last channel by convention. > > I do not know if these Bluetooth Intuos4 support mouse pucks. If so, > then we have to become concerned with only 1 tool with overlapping > ABS_WHEEL events are allowed in proximity at the same time. thanks for the explanation, I never fully got the reason for the serial. I'll rework the patch to get it right. -- Aristeu ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
