Hello!I have a Wacom Intuos5 touch tablet on my Linux Mint 14 machine. It works very well, and I'm quite pleased, however I need to configure it through command-line and scripts, as there isn't a working gui that I know of at the moment.

This is fine, and I have learned how to use it more or less, but still there is one thing I would like to do: make the button in the middle of the touch ring cycle through different ring modes, e.g. zoom, rotate, brush size, etc.

As it is now, I have configured three other buttons to change ring modes, since I wasn't able to get the ring button to cycle at all.

Any help is appreciated.

Thanks in advance!-Amir

Last edited by zorbama on Thu Mar 07, 2013 1:32 pm, edited 1 time in total.

The Mint dev.s hid the Gnome Wacom tablet applet in Mint 14 for some reason. We found out how to get it back on this thread: viewtopic.php?f=208&t=117690

I think the applet handles the touch ring settings but I am not sure. I haven't gotten direct confirmation of that, more like implied confirmation. Also it may depend on what version of the Gnome Wacom tablet applet you are dealing with. Presumably with touch ring support in more recent versions.

The Mint dev.s hid the Gnome Wacom tablet applet in Mint 14 for some reason. We found out how to get it back on this thread: viewtopic.php?f=208&t=117690

I think the applet handles the touch ring settings but I am not sure. I haven't gotten direct confirmation of that, more like implied confirmation. Also it may depend on what version of the Gnome Wacom tablet applet you are dealing with. Presumably with touch ring support in more recent versions.

Hi Favux, thanks for the reply.

I did see that thread (apologies for not mentioning that earlier), and configured the Gnome Wacom tablet applet. Most of the settings work, but I can't use it to assign buttons; it just doesn't work. Maybe it does not yet have full support to Intuos5 (which is unlikely, since it does recognize my tablet). That is why I'm using xsetwacom scripts to configure my tablet's settings, but I don't really know how to make a button cycle through options.

The Wacom applet is fairly new so it wouldn't surprise me if touch ring support just hasn't been added to it yet. At least in the Mint 14 version, which is what, Gnome 3.4? It recognizes your Intuous5 because Jason added Intuos5 entries to libwacom shortly after he added the Intuous5 code to the drivers.

So the question becomes does the driver code support touch ring mode selection? And if it does is the mode toggling signal available to user land so it could be used in a script?

Libwacom seems to indicate there is touch ring mode code because the data file for a Intuos5 has:

But more relevant to where we are now I don't see anything in xf86-input-wacom, specifically xsetwacom.c. What we'd want is to be able to use a xsetwacom get command to query the touch ring mode. Something like:

And have it return 0 or 1 or 2 or 3. That way we could have a script that would assign an action with xsetwacom set to the central button (Button 1) for each of the 4 states. If I'm correct then we need to make a feature request to the dev.s.

Well, what I do now to change the ring's behavior is modify AbsWheelUp and AbsWheelDown. I am thus able to use three different buttons to make the ring act in three different ways. I tried writing a script for the middle button that looks like this:

Interesting. From what I see in the code the touch ring state LED's are suppose to work. Can you identify mode 0,1,2,3 from them? Or do you even need them to determine what mode the touch ring is switched to?

The LEDs worked for me... once. When I clicked the middle button, the LEDs cycled. Other than that, it had no effect. It was strange, and it never happened again. I don't know how to identify the modes.

So I suppose that what I'm doing right now is changing the settings of a single mode to suit my needs, but what I could technically do is switch between the modes using the middle button, once it's configured to do so. I just need to know how to configure it.

I've looked at the wiki pages of linuxwacom. I can't seem to find anything about it.

I believe "button +4" is an X button. What it does is scroll up. AbsWheelDown is configured to "button +5", which scrolls down.

I thought the touch ring was to select the mode and the mode then determined which of 4 actions the central button, the one inside the touch ring, would take when pressed. So the script should have something like:

With one set command determined by mode for each of the 4 actions. You're saying it is the other way around? The central button toggles the modes and you touch the appropriate quadrant of the touch ring corresponding to mode 1,2,3, or 4 to get the desired action/button press? Does xsetwacom get "Wacom Intuos5 touch M Pen pad" Button 1 return mode then?

The "button +4" is an X button. 4 and 5 are reserved by X for vertical scroll while 6 and 7 are reserved for horizontal scroll. I guess if I squint I can sort of see how the driver conflates an Absolute Wheel with the touch ring. But I don't think it is suppose to do that. And we don't seem to be querying mode.

Yes, the idea is to cycle the ring's behavior between several states, which will allow me switch between, say, zooming in/out, increasing/decreasing brush size, etc.

The middle button is currently configured to open a terminal (I wasn't sure what else to do with it...), and by default it acts like a left mouse button. On the Gnome applet it's mapped to "Switch Modes", but that actually doesn't do anything.At any rate, as far as I know, "mode" is a parameter which switches between relative and absolute mode, for the cursor. I don't know of a parameter or command to assign to a button to switch ring modes.

zorbama wrote:Yes, the idea is to cycle the ring's behavior between several states, which will allow me switch between, say, zooming in/out, increasing/decreasing brush size, etc.

Well that helps clear things up. So the central button selects mode. Then how do you use the touch ring? Just touch it anywhere? Do you have to do some circular motion in one direction or the other? Sounds like it for zoom and brush size at least. And that explains the wheel conflation. I just need to get an idea of how it is suppose to work physically.

So if mode is selected by Button 1 then maybe you don't want it assigned to anything?

It would be more elegant to query the mode state directly from the command line using xsetwacom. So we could talk to the dev.s about adding that feature. The other thing is why is Button 1 getting confused and stopping setting mode state? Since apparently that is what it is suppose to do.

Yes! Following what you said, I managed to write a script to change the ring modes using the middle button and it works fantastically well!The only thing missing is the changing of the LEDs, to indicate what mode I'm on right now (I added notifications, so I have sort of an indication, only it doesn't stay).I suppose the next step would be to indeed ask the dev.s about what you said. Where can that be done?Thank you very much for your help!

If it seems messy, it's because I don't know how to organize such things. This is actually the first time I do something like that, so I'm just glad it works...To bind it to Button 1, I assigned the script to a keyboard shortcut (which is problematic to configure in the GUI in Linux Mint 14 Cinnamon, so I'm using xbindkeys as a workaround), and added to my startup settings script to assign that shortcut to Button 1.I also added to my startup script the "echo 1 >/tmp/mode_state" command, so that it will reset the setting every time.

I'll have to look your script over. While watching SyFy's Powerful Mondays I doodled together a script. The only difference I see right off the bat from yours is I put in a counter. Disclaimer: unlike your script this one isn't tested or debugged so it probably has syntax and maybe logic errors.

As you can see I was concentrating on sysfs/LEDs. I'm pretty sure status_led0_select is the file we want. And I'm reasonably sure the values are 0 to 3. But we'll need to test. First we'll have to figure out the bus number etc., so you'll need to do a locate with the tablet plugged in:

Hopefully it is with a value of 0 to 3. It's unfortunate you can't cycle through the mode states with Button 1 anymore to check on the values of the 4 states but we should be able to survive.

Or another way to find the file is to look in /dev/input/by-path. There I see for my BambooPT pci-0000:00:12.0-usb-0:2:1.1-wacom. Then in /sys/bus/usb/devices I see bus 3 is the only one with 2:1.1 so I know to look in /sys/bus/usb/devices/3-2:1.1 for BambooPT stuff. In other words for the BamboPT <busnum>-<devnum>:<cfg>.<intf> = 3-2:1.1. And I can confirm that by reading the /sys/bus/usb/devices/3-2:1.1/uevent file.

I realized I don't know if the path (bus number etc.) changes with a hot plug or reboot. If it does that will make a big difference on how we have to handle things. The other thing I don't know is if you'll need to be root to write to sysfs. I hope not. So in a terminal you'll need to test if you can change the LEDs with:

If we do have to use sudo the only practical approach I see on first thought is to somehow write a udev rule to change permissions on status_led0_select, because entering your root password each time just doesn't seem workable.

Last edited by Favux on Tue Mar 05, 2013 3:54 pm, edited 2 times in total.

I got it to work almost perfectly!Before I tried your advice with sysfs, I ran into this site: http://braindump.kargulus.de/?p=321.While it mostly talks about Intuos4, which has LEDs which you can send images to and isn't really relevant to our case, it also mentions two commands:

it makes the middle button cycle through the LEDs and runs the mode switching script. "Button 5" here isn't an X button, but rather, it's the middle button, if you count the buttons of the tablet from top to bottom (confusing, since you assign it to "button 1").

There are two problems with this, however:

I can't get it to work with my startup script, since rmmod and modprobe require root permissions.

It messes up the scrolling, since Button 5 stands for cycling through LEDs and not for vertical scroll down. I can use keys up/down, but it's problematic.

zorbama wrote:I got it to work almost perfectly!Before I tried your advice with sysfs, I ran into this site: http://braindump.kargulus.de/?p=321.While it mostly talks about Intuos4, which has LEDs which you can send images to and isn't really relevant to our case, it also mentions two commands:

Right. And sanette did some refinements to Karg's user land OLED app. All that's on the Intuos4 OLED thread: http://ubuntuforums.org/showthread.php?t=1380744 But having to remove the wacom.ko (usb kernel driver) module and restore it is why Eduardo Hasenleithner came up with the sysfs approach in the kernel. Actually he started with something different and the kernel maintainer suggested using sysfs instead.

zorbama wrote:that changes the way xsetwacom behaves. Now, if I write:

it makes the middle button cycle through the LEDs and runs the mode switching script. "Button 5" here isn't an X button, but rather, it's the middle button, if you count the buttons of the tablet from top to bottom (confusing, since you assign it to "button 1").

This totally mystifies me. Sounds like something is being reset and I don't understand the button 5. According to my BambooPT HOW TO notes I guess that would be vertical scroll down wih 4 scroll up. Why can't you just use 5? But the key thing is you've shown the Wacom drivers are disabling the indended mode selection action of Button 1, i.e. the button in the center of the touch ring. To me that appears to be a bug the dev.s need to address. Of course there may be some way to handle it already and I am ignorant of it. You know, the kind of thing if you can just read through the C code is obvious.

zorbama wrote:There are two problems with this, however:

I can't get it to work with my startup script, since rmmod and modprobe require root permissions.

It messes up the scrolling, since Button 5 stands for cycling through LEDs and not for vertical scroll down. I can use keys up/down, but it's problematic.

If scroll down makes Button 1 go through modes I don't see why that would mess with assigning vertical scroll to other buttons. Strange.

zorbama wrote:Still, we're very close to solving this puzzle!

I think so too. This is fun. You're the first who's really been interested in exploring this so I'm learning a lot.