Painting/editing type Tablet Button Set Up - Photo editing

A bit similar to my other question but more complicated. I use this for editing photo’s and usually what the buttons do suit my use but I am not making full use of them. My new tablet has even more. Looking around I found suggestions to use xinput to see what an item can do. The pad (ID=15) itself shows the correct number of buttons but I have no idea what the numbers are or how to use them -


john@linux-448o:~> xinput --list-props 15
Device 'Hanwang Art Master III 0906 pad':
        Device Enabled (137):   1
        Coordinate Transformation Matrix (139): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (270):     0
        Device Accel Constant Deceleration (271):       1.000000
        Device Accel Adaptive Deceleration (272):       1.000000
        Device Accel Velocity Scaling (273):    10.000000
        Device Node (258):      "/dev/input/event6"
        Wacom Serial IDs (301): 34088, -1, 15, 0, 0
        Wacom Serial ID binding (302):  0
        Wacom Pressure Threshold (303): 27
        Wacom Sample and Suppress (304):        2, 4
        Wacom Enable Touch (305):       0
        Wacom Enable Touch Gesture (307):       0
        Wacom Touch Gesture Parameters (308):   0, 0, 250
        Wacom Tool Type (309):  "PAD" (329)
        Wacom Button Actions (310):     "Wacom button action 0" (311), "Wacom button action 1" (312), "Wacom button action 2" (313), "None" (0), "None" (0), "None" (0), "None" (0), "Wacom button action 3" (314), "Wacom button action 4" (315), "Wacom button action 5" (330), "Wacom button action 6" (331), "Wacom button action 7" (332), "Wacom button action 8" (333)
        Wacom button action 0 (311):    1572865
        Wacom button action 1 (312):    1572866
        Wacom button action 2 (313):    1572867
        Wacom button action 3 (314):    1572872
        Wacom button action 4 (315):    1572873
        Wacom button action 5 (330):    1572874
        Wacom button action 6 (331):    1572875
        Wacom button action 7 (332):    1572876
        Wacom button action 8 (333):    1572877
        Wacom Strip Buttons (334):      "Wacom strip action 0" (335), "Wacom strip action 1" (336), "Wacom strip action 2" (337), "Wacom strip action 3" (338)
        Wacom strip action 0 (335):     1572868
        Wacom strip action 1 (336):     1572869
        Wacom strip action 2 (337):     1572868
        Wacom strip action 3 (338):     1572869
        Wacom Wheel Buttons (322):      "Wacom wheel action 0" (323), "Wacom wheel action 1" (324), "Wacom wheel action 2" (325), "Wacom wheel action 3" (326), "Wacom wheel action 4" (327), "Wacom wheel action 5" (328)
        Wacom wheel action 0 (323):     1572869
        Wacom wheel action 1 (324):     1572868
        Wacom wheel action 2 (325):     1572868
        Wacom wheel action 3 (326):     1572869
        Wacom wheel action 4 (327):     1572868
        Wacom wheel action 5 (328):     1572869
        Device Product ID (257):        2903, 34088
        Wacom Debug Levels (316):       0, 0
john@linux-448o:~> 

A device list gives this


⎜   ↳ Hanwang Art Master III 0906 stylus        id=10   [slave  pointer  (2)]
⎜   ↳ Hanwang Art Master III 0906 eraser        id=13   [slave  pointer  (2)]
⎜   ↳ Hanwang Art Master III 0906 cursor        id=14   [slave  pointer  (2)]
⎜   ↳ Hanwang Art Master III 0906 pad           id=15   [slave  pointer  (2)]

The stylus and eraser buttons on the pen work as per left and right clicks on a mouse and can be assigned in kde. No help with the buttons on the pad itself. The pad also has a touch wheel which functions in the same way as the mouse on the wheel… That works as well. The buttons appear to do something at the application level but it’s hard to tell.

If I use xev to capature and display X events there is a response to all button presses as follows for 2 of the buttons :\but as you can see there is no difference.


ButtonPress event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x4a00002, time 32227295, (33,31), root:(1297,959),
    state 0x0, button 13, same_screen YES

EnterNotify event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x0, time 32227295, (33,31), root:(1297,959),
    mode NotifyGrab, detail NotifyInferior, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  115 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonRelease event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x4a00002, time 32227671, (33,31), root:(1297,959),
    state 0x0, button 13, same_screen YES

LeaveNotify event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x0, time 32227671, (33,31), root:(1297,959),
    mode NotifyUngrab, detail NotifyInferior, same_screen YES,
    focus YES, state 0




ButtonPress event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x4a00002, time 32241999, (33,31), root:(1297,959),
    state 0x0, button 13, same_screen YES

EnterNotify event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x0, time 32241999, (33,31), root:(1297,959),
    mode NotifyGrab, detail NotifyInferior, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  115 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

ButtonRelease event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x4a00002, time 32242327, (33,31), root:(1297,959),
    state 0x0, button 13, same_screen YES

LeaveNotify event, serial 40, synthetic NO, window 0x4a00001,
    root 0x173, subw 0x0, time 32242327, (33,31), root:(1297,959),
    mode NotifyUngrab, detail NotifyInferior, same_screen YES,
    focus YES, state 0


It seems from some out of date tutorials the above should help?? If I look in man xinput there are no examples so it’s rather difficult to determine what some of them do even set-button-map. Not at all all sure this does what I want to do anyway plus some of the buttons do work - eg scroll wheel.

'elp

The sort of thing I need to do is assign shift to one button on the pad and cntrl to another etc

12.3 KDE

John

:’( All of a sudden I am getting individual button number identifiers out of xev. No idea why. :OSuppose that’s an improvement.

John

Part way there. The 1st post output for xinput found which device had the keys the number 15, the device number, was obtained from this


john@linux-448o:~> xsetwacom --list devices
Hanwang Art Master III 0906 stylus      id: 10  type: STYLUS    
Hanwang Art Master III 0906 eraser      id: 13  type: ERASER    
Hanwang Art Master III 0906 cursor      id: 14  type: CURSOR    
Hanwang Art Master III 0906 pad         id: 15  type: PAD       
john@linux-448o:~> 
 

Then keys can be assigned as follows. In this case left click, right click, shift key and cntrl key in the order shown


john@linux-448o:~> xsetwacom --set "Hanwang Art Master III 0906 pad" Button 13 1
john@linux-448o:~> xsetwacom --set "Hanwang Art Master III 0906 pad" Button 12 3
john@linux-448o:~> xsetwacom --set "Hanwang Art Master III 0906 pad" Button 11  "key shift"
john@linux-448o:~> xsetwacom --set "Hanwang Art Master III 0906 pad" Button 10  "key ctrl"

The most useful web help page is this one https://wiki.archlinux.org/index.php/Wacom_Tablet

These key settings aren’t persistent so next thing is to get them into the config file in /etc/X11/xorg.conf.d

Opensuse has left a bit of a problem there. The tablet configuration file looks nothing like the arch example and doesn’t split up the devices in the tablet. I initially installed the Wacom driver with YAST. Some of that was updated when I installed the KDE tablet set up but the config file didn’t change. The problem with it is that all of the elements in the tablet show via xsetwacom have buttons and each can have unique settings and it seems the x config file for it can also split them up. It hasn’t.

John

Having messed up and recovered my machine assuming that buttons on the pad can have key codes assigned to them I have finally found some Xorg docs that are fairly recent and state that this can not be done in the config files and has to be done via xsetwacom at run time. All that can be done in the conf files is button remapping eg on a mouse swapping left and right click mouse buttons over.

:sarcastic: This sort of explains why tutorials etc tend to gloss over it. On the other hand they could state how it must be done.

What I need now is a suitable file that always runs to place the commands in. Needs to run after X is fully up and running. Any thoughts? I may want to start up cron jobs in the same file at some point and add other things.

An alternative that ran after user log in would be useful too so I could try out different tablets.

John

It looks like the easiest answer is to run it with kde autostart, found in settings ,start up shut down., I have seen the which script runs when question several times before asking but have never seen an answer - only super complicated ones for configuration. I added this bash script and checked that the keys functioned using xev. The echo line is a waste of time. I assumed that KDE would have a run in terminal option with feedback as it’s handy for checking things like this - no such luck. Seems some create a desktop file to get round this aspect. Wonder why they didn’t.


#! /bin/bash

#Hanwang Art Master III 0906 pad button settings for a KDE AutoStart entry
#Button 13 is bottom left for right hand use and settings run upwards in this file
#Buttons 7,6,5,4,1 are the scroll wheel and it's button. The button (1) defaults to a left
## click and may be multiway too.
# Assigning 4 is equal to a middle button mouse click / centre button on the pen

xsetwacom --set "Hanwang Art Master III 0906 pad" Button 13 "key shift"
xsetwacom --set "Hanwang Art Master III 0906 pad" Button 12 "key ctrl"
xsetwacom --set "Hanwang Art Master III 0906 pad" Button 11 "key alt"
xsetwacom --set "Hanwang Art Master III 0906 pad" Button 10 4

#xsetwacom --set "Hanwang Art Master III 0906 pad" Button 9
#xsetwacom --set "Hanwang Art Master III 0906 pad" Button 8
#xsetwacom --set "Hanwang Art Master III 0906 pad" Button 3
#xsetwacom --set "Hanwang Art Master III 0906 pad" Button 2
#xsetwacom --set "Hanwang Art Master III 0906 pad" Button 1

echo $?
 

It runs created at user level and marked as an executable. I believe it should be put in ~/user name /bin

rotfl!Hanvon/Hanwang provide a spare pen and often this doesn’t have the centre button click. Seems all Artmaster III 's are wacom compatible.

John