On Sat, Feb 18, 2012 at 7:32 PM, Adam Nielsen <a.niel...@shikadi.net> wrote:
> Hi Chris,
>
> A couple more questions...
>
>
>>> This worked quite well.  I do however get two identical devices appearing
>>> (both tablets with buttons) rather than one tablet and one set of buttons
>>> as
>>> I think would be more logical.  Not sure how to address this though.
>>
>>
>> Its wacom_setup_input_capabilities() job to declare and not declare
>> correct events for each interface.  Right now, all devices have an X/Y
>> so you'll have a new case of button only.
>>
>> For temporary hack, I'd check for pktlen or interface # in that
>> function to hide what you need.  For other multi-interface cases, 1
>> interface is a stylus tablet and 1 interface is a touchpad so we 1st
>> set and then check device_type to see what events to hide.
>
>
> I'm a bit stuck on this.  As far as I can tell,
> wacom_setup_input_capabilities() is called once for each interface (so one
> call for the stylus and one for the buttons) but the wacom_features
> structure seems to be shared between them both.  This means that I can't
> check pktlen as it will be the same for both interfaces.

wacom_features is not shared exactly.  Each interface has its own
features but its value is initialized from a common value.

What you need to do is figure out a way to touch up the values that do
not make sense for a given interface.  Normally, this is done in
wacom_parse_hid() but in your case it probably needs to be done
somewhere else (I'll help figure that out with you soon but for now
just hardcode it in wacom_probe() somehow).


>
> Likewise I can't check the USB interface number, as that doesn't seem to be
> passed to wacom_setup_input_capabilities().

True, put you can check USB interface # in wacom_probe() and override
pkglen there.  Then you can base your settings in
wacom_setup_input_capabilities() based on pktlen.

FYI: I realize this all looks kinda ugly.  I'm working on some ideas
on how to clean this up.  As long as you get this working, I'll help
clean it up.

>
> Am I misunderstanding this, or is there another way I can work out what
> interface I'm accessing inside wacom_setup_input_capabilities()?
>
>
>> We kinda need a new device type that says Pad-only.  Probably a fixed
>> value of 0 to mean !Pen and !Touch will be good enough for now.
>
>
> I'm not quite sure what you mean by this.  I have a few ideas but none of
> them worked out due to the shared wacom_features so I think I misunderstand.

Maybe this will be helpful to understand what I'm thinking.  I'm
working on support for a wireless module that has 3 USB interfaces:  A
monitor interface (so you can detect when wireless tablet is
connected), a pen interface, and a touch interface.  To help out, I
gave the device type a unique name (BAMBOO_WIRELESS) and then I set
device_type to either 0, STYLUS, or DOUPLETAP (touch) depending on
interface #.  I also set pktlen when needed based on interface #.

http://www.spinics.net/lists/linux-input/msg19345.html

Between device_type and pkglen, I can tell what interface I'm running
on without looking at interface # any more.

Chris

>
> Thanks,
> Adam.
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to