From: Jason G. <kil...@gm...> - 2012-03-14 19:16:42
|
On Wed, Mar 14, 2012 at 9:20 AM, T Hall <tah...@gm...> wrote: > For a while I have been noticing some very strange behaviour from > xsetwacom. > > My system: > Archlinux > xf86-input-wacom version 0.14 from official arch repos > Wacom Intuos3 6x8 > > I have a script to set up my tablet using various calls to xsetwacom > (attached: tablet_setup.sh). After running the script once, often the > wrong key combination is mapped to StripLeftUp (It will output x > instead of f). In this case, running the script a second time will > usually result in the correct mapping. > > However, even when the script has mapped the Left Strip Up to the > correct key output, xsetwacom --get on the pad device shows different > values (See attached file: xsetwacom-get-output). All the Buttons are > Touch Strip options are wrong except StripRightDown. e.g. I move my > finger up the left touch strip, it outputs "f", but xsetwacom --get > claims it's mapped to "key +x -x " > > At first, I thought this only seemed to happen when xsetwacom --set is > called from within a script. The reason for this is that it seems to be > a case of one call to xsetwacom overwriting what was mapped by a > previous call, hence a single call to xsetwacom won't produce the bug. > > For example, to produce the bug in the terminal: > $ xsetwacom --set "Wacom Intuos3 6x8 pad" "StripLeftUp" "key +g -g" > $ xsetwacom --get "Wacom Intuos3 6x8 pad" "StripLeftUp" > key +g -g > $ xsetwacom --set "Wacom Intuos3 6x8 pad" "Button" "1" "key +x -x" > $ xsetwacom --get "Wacom Intuos3 6x8 pad" "StripLeftUp" > key +x -x > > Following this, using the left strip up outputs "g". > > It appears that StripLeftUp is set correctly, but then setting Button 1 > interferes with it in a very strange manner, changing the value that > xsetwacom *thinks* it is set to, and sometimes (see the issue > mentioned above when the script is run once only) but not always > changing the value it *is* set to. > > If the order of the xsetwacom --set commands is reversed, so that > "Button 1" is set first, followed by "StripLeftUp", then "Button 1"'s > mapping gets overwritten by "StripLeftUp"'s. > > Note that while the strip functions do have button numbers, 1 is not > StripLeftUp, it is the top right button on the left hand side. (IIRC, > the 4 touch strip functions are Buttons 4,5,6,7) > > Apologies for the length of this email; it's a very odd and slightly > unpredictable behaviour, so I wanted to make sure I described as fully > as possible. > > Regards > T Hall Looks like the cause is xsetwacom re-using action atoms when it shouldn't. When creating the name for an action atom, xsetwacom takes the standard prefix "Wacom button action" and appends a number corresponding to the array index the atom will be stored at. Both button 1 and StripLeftUp are stored in array index 1 of different properties, and wind up having the same action atom name. When setting either button 1 or StripLeftUp, we modify the "Wacom button 1" property, which winds up changing the action to be performed for both... I'll whip up a patch that should fix this shortly... Jason --- Day xee-nee-svsh duu-'ushtlh-ts'it; nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it. Huu-chan xuu naa~-gha. |