Thread: [DIGImend-devel] Support for Genius PenSketch M912 (take two)
Brought to you by:
spb_nick
|
From: Milan P. <mil...@gm...> - 2014-12-16 21:05:37
Attachments:
m912_support.patch
m912_fixed.xml
|
Good day, my last year's efforts to submit patch implementing support for $subj were stopped by real life and its implications :). Attached is modified patch for current kernel master and fixed report descriptor XML. Patch was tested and works correctly with M912. Some tablet keys do not work in xorg (evtest correctly reports them), but that is caused by X server limitation (see https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/313514 ). If necessary, I can change mappings to usable keys, but I tried to keep key semantics and to be consistent with other report descriptors in hid-kye.c . Best regards, Milan Plzik |
|
From: Nikolai K. <sp...@gm...> - 2014-12-30 16:02:54
|
Hi Milan, On 12/30/2014 05:09 PM, Milan Plžík wrote: > if possible, could you have a look on attached patch/comment on any merge > blockers? Thanks for sending the patch! Sorry for the delay with reviewing this. I had some difficulty managing things in the project and might still do. It looks mostly fine, I have two comments only. > + 0x05, 0x0D, /* Usage Page (Digitizer), */ > + 0x09, 0x21, /* Usage (Puck), */ > + 0xA1, 0x01, /* Collection (Application), */ > + 0x85, 0x11, /* Report ID (17), */ > + 0x09, 0x21, /* Usage (Puck), */ > + 0xA0, /* Collection (Physical), */ > + 0x05, 0x09, /* Usage Page (Button), */ > + 0x75, 0x01, /* Report Size (1), */ > + 0x19, 0x01, /* Usage Minimum (01h), */ > + 0x29, 0x03, /* Usage Maximum (03h), */ > + 0x14, /* Logical Minimum (0), */ > + 0x25, 0x01, /* Logical Maximum (1), */ > + 0x95, 0x03, /* Report Count (3), */ > + 0x81, 0x02, /* Input (Variable), */ > + 0x95, 0x04, /* Report Count (4), */ > + 0x81, 0x01, /* Input (Constant), */ > + 0x95, 0x01, /* Report Count (1), */ > + 0x0B, 0x32, 0x00, 0x0D, 0x00, /* Usage (Digitizer In Range), */ > + 0x14, /* Logical Minimum (0), */ > + 0x25, 0x01, /* Logical Maximum (1), */ > + 0x81, 0x02, /* Input (Variable), */ > + 0xA4, /* Push, */ There doesn't seem to be a Pop for this Push. It will probably work this way, but that's not neat and confusing. > + 0x05, 0x01, /* Usage Page (Desktop), */ > + 0x75, 0x10, /* Report Size (16), */ > + 0x95, 0x01, /* Report Count (1), */ > + 0x55, 0xFD, /* Unit Exponent (-3), */ > + 0x65, 0x13, /* Unit (Inch), */ > + 0x14, /* Logical Minimum (0), */ > + 0x34, /* Physical Minimum (0), */ > + 0x09, 0x30, /* Usage (X), */ > + 0x27, 0x00, 0xF0, 0x00, 0x00, /* Logical Maximum (61440), */ > + 0x46, 0xE0, 0x2E, /* Physical Maximum (12000), */ > + 0x81, 0x02, /* Input (Variable), */ > + 0x09, 0x31, /* Usage (Y), */ > + 0x27, 0x00, 0xB4, 0x00, 0x00, /* Logical Maximum (46080), */ > + 0x46, 0x28, 0x23, /* Physical Maximum (9000), */ > + 0x81, 0x02, /* Input (Variable), */ > + 0x09, 0x38, /* Usage (Wheel), */ > + 0x75, 0x08, /* Report Size (8), */ > + 0x95, 0x01, /* Report Count (1), */ > + 0x15, 0xFF, /* Logical Minimum (-1), */ > + 0x25, 0x01, /* Logical Maximum (1), */ > + 0x34, /* Physical Minimum (0), */ > + 0x44, /* Physical Maximum (0), */ > + 0x81, 0x06, /* Input (Variable, Relative), */ > + 0xC0, /* End Collection, */ > + 0xC0, /* End Collection, */ > + 0x05, 0x0C, /* Usage Page (Consumer), */ > + 0x09, 0x01, /* Usage (Consumer Control), */ > + 0xA1, 0x01, /* Collection (Application), */ > + 0x85, 0x12, /* Report ID (18), */ > + 0x14, /* Logical Minimum (0), */ > + 0x25, 0x01, /* Logical Maximum (1), */ > + 0x75, 0x01, /* Report Size (1), */ > + 0x95, 0x08, /* Report Count (8), */ > + 0x05, 0x0C, /* Usage Page (Consumer), */ > + 0x0B, 0x45, 0x00, 0x0D, 0x00, /* Usage (Digitizer Eraser), */ Does this really work? What happens if I press this button? > + 0x0A, 0x1A, 0x02, /* Usage (AC Undo), */ > + 0x0A, 0x01, 0x02, /* Usage (AC New), */ > + 0x0A, 0x2F, 0x02, /* Usage (AC Zoom), */ > + 0x0A, 0x25, 0x02, /* Usage (AC Forward), */ > + 0x0A, 0x24, 0x02, /* Usage (AC Back), */ > + 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */ > + 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */ > + 0x81, 0x02, /* Input (Variable), */ > + 0x95, 0x30, /* Report Count (48), */ > + 0x81, 0x03, /* Input (Constant, Variable), */ > + 0xC0 /* End Collection */ > +}; > + Otherwise it looks good to me. Nick |
|
From: Milan P. <mil...@gm...> - 2015-01-18 18:47:43
Attachments:
m912_fixed.xml
m912_support.patch
|
Hello Nikolai,
thank you for your comments. I added the missing <pop/> element.
With the 'digitizer eraser' button, I hoped to temporarily switch a tool
to eraser, but as you noted, that did not work. I reverted it to AC
Delete, which is probably the closest description I could find in the
HID Usage Tables document. Attached is both the kernel patch to current
master and the fixed descriptor XML.
Best regards,
Milan
On 12/30/2014 05:02 PM, Nikolai Kondrashov wrote:
> Hi Milan,
>
> On 12/30/2014 05:09 PM, Milan Plžík wrote:
>> if possible, could you have a look on attached patch/comment on any merge
>> blockers?
>
> Thanks for sending the patch!
> Sorry for the delay with reviewing this.
> I had some difficulty managing things in the project and might still do.
>
> It looks mostly fine, I have two comments only.
>
>> + 0x05, 0x0D, /* Usage Page (Digitizer), */
>> + 0x09, 0x21, /* Usage (Puck), */
>> + 0xA1, 0x01, /* Collection (Application), */
>> + 0x85, 0x11, /* Report ID (17), */
>> + 0x09, 0x21, /* Usage (Puck), */
>> + 0xA0, /* Collection (Physical), */
>> + 0x05, 0x09, /* Usage Page (Button), */
>> + 0x75, 0x01, /* Report Size (1), */
>> + 0x19, 0x01, /* Usage Minimum (01h), */
>> + 0x29, 0x03, /* Usage Maximum (03h), */
>> + 0x14, /* Logical Minimum (0), */
>> + 0x25, 0x01, /* Logical Maximum (1), */
>> + 0x95, 0x03, /* Report Count (3), */
>> + 0x81, 0x02, /* Input (Variable), */
>> + 0x95, 0x04, /* Report Count (4), */
>> + 0x81, 0x01, /* Input (Constant), */
>> + 0x95, 0x01, /* Report Count (1), */
>> + 0x0B, 0x32, 0x00, 0x0D, 0x00, /* Usage (Digitizer In Range), */
>> + 0x14, /* Logical Minimum (0), */
>> + 0x25, 0x01, /* Logical Maximum (1), */
>> + 0x81, 0x02, /* Input (Variable), */
>> + 0xA4, /* Push, */
>
> There doesn't seem to be a Pop for this Push. It will probably work this
> way,
> but that's not neat and confusing.
>
>> + 0x05, 0x01, /* Usage Page (Desktop), */
>> + 0x75, 0x10, /* Report Size (16), */
>> + 0x95, 0x01, /* Report Count (1), */
>> + 0x55, 0xFD, /* Unit Exponent (-3), */
>> + 0x65, 0x13, /* Unit (Inch), */
>> + 0x14, /* Logical Minimum (0), */
>> + 0x34, /* Physical Minimum (0), */
>> + 0x09, 0x30, /* Usage (X), */
>> + 0x27, 0x00, 0xF0, 0x00, 0x00, /* Logical Maximum (61440), */
>> + 0x46, 0xE0, 0x2E, /* Physical Maximum (12000), */
>> + 0x81, 0x02, /* Input (Variable), */
>> + 0x09, 0x31, /* Usage (Y), */
>> + 0x27, 0x00, 0xB4, 0x00, 0x00, /* Logical Maximum (46080), */
>> + 0x46, 0x28, 0x23, /* Physical Maximum (9000), */
>> + 0x81, 0x02, /* Input (Variable), */
>> + 0x09, 0x38, /* Usage (Wheel), */
>> + 0x75, 0x08, /* Report Size (8), */
>> + 0x95, 0x01, /* Report Count (1), */
>> + 0x15, 0xFF, /* Logical Minimum (-1), */
>> + 0x25, 0x01, /* Logical Maximum (1), */
>> + 0x34, /* Physical Minimum (0), */
>> + 0x44, /* Physical Maximum (0), */
>> + 0x81, 0x06, /* Input (Variable, Relative), */
>> + 0xC0, /* End Collection, */
>> + 0xC0, /* End Collection, */
>
>> + 0x05, 0x0C, /* Usage Page (Consumer), */
>> + 0x09, 0x01, /* Usage (Consumer Control), */
>> + 0xA1, 0x01, /* Collection (Application), */
>> + 0x85, 0x12, /* Report ID (18), */
>> + 0x14, /* Logical Minimum (0), */
>> + 0x25, 0x01, /* Logical Maximum (1), */
>> + 0x75, 0x01, /* Report Size (1), */
>> + 0x95, 0x08, /* Report Count (8), */
>> + 0x05, 0x0C, /* Usage Page (Consumer), */
>> + 0x0B, 0x45, 0x00, 0x0D, 0x00, /* Usage (Digitizer Eraser), */
>
> Does this really work? What happens if I press this button?
>
>> + 0x0A, 0x1A, 0x02, /* Usage (AC Undo), */
>> + 0x0A, 0x01, 0x02, /* Usage (AC New), */
>> + 0x0A, 0x2F, 0x02, /* Usage (AC Zoom), */
>> + 0x0A, 0x25, 0x02, /* Usage (AC Forward), */
>> + 0x0A, 0x24, 0x02, /* Usage (AC Back), */
>> + 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
>> + 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
>> + 0x81, 0x02, /* Input (Variable), */
>> + 0x95, 0x30, /* Report Count (48), */
>> + 0x81, 0x03, /* Input (Constant, Variable), */
>> + 0xC0 /* End Collection */
>> +};
>> +
>
> Otherwise it looks good to me.
>
> Nick
|
|
From: Nikolai K. <sp...@gm...> - 2015-01-25 13:41:49
|
Hi Milan, On 01/18/2015 08:47 PM, Milan Plžík wrote: > thank you for your comments. I added the missing <pop/> element. With the > 'digitizer eraser' button, I hoped to temporarily switch a tool to eraser, > but as you noted, that did not work. I reverted it to AC Delete, which is > probably the closest description I could find in the HID Usage Tables > document. Attached is both the kernel patch to current master and the fixed > descriptor XML. Sorry for another delay. I think it is fine. Even though the button functions don't match the pictures beside them exactly, it is more important for them to be actually useful to users. With regards to actually contributing this, I think with this patch quality you can go directly to the kernel maintainers. Send this patch (with "git send-email", if you can) to Jiri Kosina <jk...@su...> and CC it to lin...@vg.... Please also CC dig...@li... and me and I'll put my Reviewed-by on it, FWIW. Thanks a lot for your work! Another good thing to do would be contributing this to digimend-kernel-drivers [1] as well, so users of older kernel versions can use it sooner/more easily. Regarding the report descriptor XML, I'd like to note that you can use the "PUSH" (uppercase) element instead of the "push"/"pop" element pair to make it standout more. But if you don't plan to write any more report descriptor in hidrd XML, it shouldn't matter to you :) Regarding the buttons, I've experimented a little with making the hid-huion.c driver report generic button presses [2], which can then be remapped by xf86-input-wacom, but hasn't arrived to a good compatible solution yet. Perhaps you can take some ideas from there to improve your tablet button mapping. Nick [1] https://github.com/DIGImend/digimend-kernel-drivers [2] https://github.com/DIGImend/digimend-kernel-drivers/tree/huion-abstract-keyboard |