I'm fairly sure that the instructions below are correct. These instructions may be incorporated into a guide here as well: http://ubuntuforums.org/showthread.php?t=1656089 That guide will also have instructions for other, similar setups.
I followed this post and it seems correct, if cryptic: http://ubuntuforums.org/showpost.php...0&postcount=15. I'm going to state my interpretation of that here, and I'll also cover changing vertical values for those who have different resolutions on their monitors.
Preliminaries:
These instructions assume that you haven't changed anything using xsetwacom. If you have, you should reset to default values (that is, the stylus should work normally when no external monitor is connected); rebooting should accomplish this. Also, I'm using xf86-input-wacom 0.10.8. I'm using
Code:
xsetwacom set "Serial Wacom Tablet Stylus" Screen_No -1
I don't fully understand this setting yet, though it doesn't appear to do anything.
I'm using xrandr to use an external monitor, so this may not work for those using the nvidia drivers.
Using xsetwacom:
To start with, we're going to need to get some values using xinput. Read the output of
and find the lines that correspond to your stylus and eraser (if you have one). For me, it's this:
Code:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Serial Wacom Tablet eraser id=13 [slave pointer (2)]
⎜ ↳ Serial Wacom Tablet stylus id=14 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=11 [slave pointer (2)]
⎜ ↳ Logitech USB Gaming Mouse id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=12 [slave keyboard (3)]
Also notice the id for each device; this will make the commands a fair bit shorter. The device ids can change, so if you're going to write scripts to automate this, then you need to use the device names in quotes. Run the following commands:
Code:
xsetwacom get [device name/id] BottomX
xsetwacom get [device name/id] BottomY
the first value will be called Wxsw(Left+Right) and the second will be called Hxsw(Large) (these labels will make sense later). It's a good idea to record these somewhere. They appear to correspond to the resolution of the wacom digitizer, and better tablets will have larger values......I think.
Example:
Code:
zsharon@Weierstrass:~$ xsetwacom get "Serial Wacom Tablet stylus" BottomX
24576
Of course the stylus only works by pointing it at the tablet screen, but we can easily control which screen the pointer appears on, and we'll scale it correctly so that pointing the stylus at the bottom right corner of the tablet screen will move the pointer to the bottom right corner of whichever screen we've chosen, regardless of the resolution. You'll generally use this only to restrict the stylus to the tablet screen, but I found it more clear to write this more generally since an external monitor can be on the right or the left.
Horizontal settings:
Using "Left" and "Right" to refer to our monitors only with regard to their xinput topology (that is, we don't care which is physically on the left, only which X thinks is on the left), we'll use the following notation:
Code:
Wxsw(monitor) = the width that xsetwacom seems to ascribe to the screen,
Wact(monitor) = the "actual" physical width in pixels of the screen.
These can also be used for the whole display, so Wact(Left+Right) is the sum of the physical widths of the two displays; in other words, it's the same as Wact(Left)+Wact(Right). The number we found earlier for Wxsw(Left+Right) is how wide xsetwacom thinks the whole display is.
Now, for reasons unknown,
Code:
Wxsw(Left)*Wact(Left)=Wxsw(Right)*Wact(Right)=Wxsw(Left+Right)*Wact(Left+Right)
In other words, the width ascribed to a screen by xsetwacom is inversely proportional to its physical width, with constant of proportionality equal to Wxsw(-)*Wact(-) for any of the screens involved. Since we know Wact(-) for each of our screens, knowing Wxsw(-) for any one of them gives us a numerical value for the constant of proportionality and allows us to determine Wxsw(-) for each of the others. For example, if we know
Code:
Wxsw(Left+Right)=24576
Wact(Left+Right)=Wact(Left)+Wact(Right)=1280+1024=2304
Wact(Right)=1024
Then the constant of proportionality is
Code:
Wxsw(Left+Right)*Wact(Left+Right)=24576*2304=56623104
and therefore
Code:
Wxsw(Right)=Wxsw(Left+Right)*Wact(Left+Right)/Wact(Right)=56623104/1024=55296
so xsetwacom sees the Right display as being 55,296 units wide.
So how do we use this? Disconnect any external monitor and restart your computer to reset the xsetwacom values (simply restarting X may be enough). Use xrandr to connect the secondary display and check that the stylus is (incorrectly) mapped across both screens. Use
Code:
xsetwacom get [device name/id] BottomX
as detailed above to find Wxsw(Left+Right). Use this number to find Wxsw(Left) and Wxsw(Right).
Now, if you wish to map the stylus to the Left screen, use "xsetwacom set" to set the following values:
Code:
TopX = 0
BottomX = Wxsw(Left)
We set TopX=0 since we want the stylus to abut the left edge of the whole display, and we set BottomX=Wxsw(Left) so that the stylus uses the proper width, that is we want
Code:
BottomX-TopX=Wxsw(Left)
If you wish to map the stylus to the Right screen, use "xsetwacom set" to set the following values:
Code:
TopX = Wxsw(Left+Right)-Wxsw(Right)
BottomX = Wxsw(Left+Right)
We set BottomX=Wxsw(Left+Right) so the the stylus abuts the right edge of the display (remember that Wxsw(Left+Right) is the width that xsetwacom assigns to the whole display) and set TopX=Wxsw(Left+Right)-Wxsw(Right) so that the stylus uses the proper width, which is
Code:
BottomX-TopX=Wxsw(Left+Right)-[Wxsw(Left+Right)-Wxsw(Right)]=Wxsw(Right)
To continue the earlier example, if I want to map my stylus to the Right screen only, then I use
Code:
xsetwacom set 14 TopX -30720
xsetwacom set 14 BottomX 24576
Yes, I use a negative value for TopX, which seems odd, but it works.
To recap:
Code:
1. Find Wxsw(-) for the default (wrong) setting.
2. Compute the constant of proportionality.
3. Find Wxsw(Left) or Wxsw(Right).
4. Input values.
Unless you change the resolutions for your screens, you should only have to find the constant of proportionality once.
Vertical settings:
When you use xrandr to use a second monitor, the stylus should scale according to the larger screen, so if you intend to use the stylus with the larger screen, no changes are needed.
If you want to use the stylus with a screen which is the smaller of the two screens, then you'll want to adjust the vertical as well. All you should need to do is scale things. Let
Code:
Hact(Large) = Larger screen height in pixels
Hact(Small) = Smaller screen height in pixels
Hxsw(Large) = height xsetwacom assigns to the larger screen
Hxsw(Small) = height xsetwacom assigns to the smaller screen
Again, these values are related by
Code:
Hact(Large)*Hxsw(Large)=Hact(Small)*Hxsw(Small)
To get the value needed to restrict the stylus to the vertical region spanned by the smaller screen, obtain Hxsw(Large) using
Code:
xsetwacom get [device name/id] BottomY
and set
Code:
BottomY = Hsxw(Small)=Hxsw(Large)*Hact(Large)/Hact(Small)
using the command
Code:
xsetwacom set [device name/id] BottomY VALUE
For me, this is 18342*1024/768=24456, so
Code:
xsetwacom set 14 BottomY 24456
sets my stylus to have the desired height range. Of course, I still have TopY = 0.
Eraser:
If you have an eraser on your stylus, don't forget to adjust the eraser as well. Use the same commands you used for the stylus but with the id for the eraser instead.
I hope this is clear enough.
Bookmarks