Menu

#303 xsetwacom can't parse its own output

closed-fixed
None
xf86-input-wacom
2016-05-16
2016-01-09
No

While developing a simple GUI for xsetwacom, I discovered this big issue, if it won't be fixed I'll try some heuristic fixes on xsetwacom output
Just see:

% xsetwacom set "10" "Button" "9" "key +Alt_L key +m key -m key -Alt_L "
% xsetwacom -s --get 10 all 2>/dev/null|grep Alt_L
xsetwacom set "10" "Button" "9" "+Alt_L +m -m -Alt_L "
% xsetwacom set "10" "Button" "9" "+Alt_L +m -m -Alt_L
Cannot parse keyword '+Alt_L' at position 1

there is no "key" prefix, meanwhile this command have a proper output:

% xsetwacom -s --get 10 Button 9
xsetwacom set "10" "Button" "9" "key +Alt_L +m -m -Alt_L "

The bug only happens with the "all" option, so I can easily work it around at price of more shell calls... I'll check the priority you give to it.

Discussion

  • Jason Gerecke

    Jason Gerecke - 2016-01-12

    Could you please let us know what distribution (and version) you are using, as well as the output from xsetwacom -V? I've copy/pasted your commands on my own boxes and they have the "key" prefix when using the "all" option. Its likely that this is not a bug in the most recent release.

     
    • Fabien Devaux

      Fabien Devaux - 2016-01-12

      I am using arch Linux and xf86 input Wacom 0.32.0

       

      Last edit: Jason Gerecke 2016-01-12
  • Jason Gerecke

    Jason Gerecke - 2016-01-12

    I think I have found the source of this bug. Please follow the instructions on our wiki for compiling and installing xf86-input-wacom from source. You'll want to apply the attached patch file which should fix the bug.

     
  • Fabien Devaux

    Fabien Devaux - 2016-01-17

    The patch fixes the issue here, I just applied the patch inside the latest archlinux package (using version 0.32.0).
    Btw, I worked on a simple, "no installation needed", GUI to generate xsetwacom shell scripts.
    You can find it here: https://github.com/fdev31/wakey

    I may need to simplify the UI a bit more (especially startup display)... the main point is it's very easy to maintain up-to-date tablet support, it's a matter of updating an svg file.

    So I have two questions: Do you have some mapping of the different wacom tablets so I can add support for them ? Do you think this app can be included in something else or promoted or whatever so it will be more popular/useful for people ?

     
  • Jason Gerecke

    Jason Gerecke - 2016-01-18
    • status: new --> pending
    • assigned_to: Jason Gerecke
     
    • Fabien Devaux

      Fabien Devaux - 2016-01-18

      Ok, thanks for the tip !!
      I took a look and it is very interesting, but I may have two difficulties:
      - figuring out the mapping between xsetwacom output and libwacom, probably
      not too complex
      - figuring out the buttons naming scheme, eg: my bamboo fun small has 1 8 3
      7 buttons set (or 1 3 7 8 depends if you read lines or columns... while
      libwacom uses ABCD... can I generalize it ? <POS> <10-POS> <POS> <10-POS) ?
      Given 10-POS are right and "POS" are left ? :/

      Kr

       

      Last edit: Jason Gerecke 2016-01-18
      • Jason Gerecke

        Jason Gerecke - 2016-01-19

        Unfortunately there's not (yet) any universal way to turn a libwacom button name into an xsetwacom button number. For e.g. Intuos Pro, Cintiq, and other high-end devices you can reliably use the following algorithm (with the result that 'A'=1, 'B'=2, 'C'=3, 'D'=8, 'E'=9, ...)

        xsetwacom_button_number = ascii(libwacom_name) - ascii('A') + 1
        if (xsetwacom_button_number >= 4) then xsetwacom_button_number += 4
        

        For Bamboo and other consumer devices though this doesn't work. Button 1 may not necessarily be the same as button 'A', and (as you can see with your device) there are some button numbers (4, 5, 6, and 7) which the algorithm will never return. The short explanation is that buttons are handled differently for these tablets, and that there's no real way to turn an X11 button number (which xsetwacom uses) back into a physical button number (which libwacom uses).

         
        • Fabien Devaux

          Fabien Devaux - 2016-01-19

          Thank you so much!

           

          Last edit: Jason Gerecke 2016-01-19
  • Jason Gerecke

    Jason Gerecke - 2016-01-18

    Thanks for the confirmation -- I'll send it to the mailinglist for review and merging. Should be addressed on 0.33.0.

    As for your GUI, you might be interested in "libwacom". Although the C library interfaces won't be too useful for your Javascript code, it does contain data about and SVG layouts of quite a few different tablets. The license terms are pretty easy to abide by too :) You could potentially "promote" it on our wiki's page about "external applications", but I'd wait until it supported a few more models. Another option would be to let people know about it (and potentially ask for feedback) via forums and other social media.

     
  • Jason Gerecke

    Jason Gerecke - 2016-01-26
    • status: pending --> pending-fixed
     
  • Jason Gerecke

    Jason Gerecke - 2016-01-26

    Fixed in commit e1df2c3 (along with similar issue in commit bccfc6f). Expected release: xf86-input-wacom 0.33.0

     
  • Jason Gerecke

    Jason Gerecke - 2016-05-16
    • status: pending-fixed --> closed-fixed
     
  • Jason Gerecke

    Jason Gerecke - 2016-05-16

    Fix available in xf86-input-wacom 0.33.0