USING A CALCOMP TABLET WITH XINPUT This document and accompanying code outline how to get a Calcomp drawing tablet working with XInput. First, you should know that I only have one Calcomp tablet. It is a DrawingSlate II. I suspect that what I have done will work with most Calcomp tablets, especially those in the Drawing* and Ultra* series, but if it doesn't work with a Calcomp 2000 or whatever, there is nothing I can do to help. Of couse, I take no responsability for any negative impact from following the instructions below. If you do what I did, you'll probably end up with a working tablet. But I suppose it is also possible that you'll end up with smoke spewing from your serial port. If that worries you, you should probably stop reading right now, delete this file, reformat the partition it was on, and switch to BeOS or sumpthin. Still here? Well, you've been warned. Now, I am generally a lazy person. I don't have any knowledge of Calcomp protocols, and I have no interest in reverse engineering them. Therefore, rather than building a new driver, I just made once of the existing drivers a bit mor foregiving so that it would work with my tablet in an emulation mode. I chose to modify the SummaSketch driver because it is simpler, and because my tablet emulates SummaSketch tablets quite well. However, the emulation isn't perfect. The main shortcoming in Calcomp's emulation is that the tablet only knows how to say one thing: the current position and buttons. When the SummaSketch driver starts, the first thing it asks is "What is your firmware ID." The DrawingSlate responds with coordinates, which causes the Summa driver to abort. Even if the Calcomp's response was seen as a valid firmware ID (it's possible, if you hold the pointer in just the right place...), the next thing the driver would ask is for the tablet's size. The Calcomp's response of _current_ x,y would appear valid, but would mess up the scaling unless you happened to be pointing at the lower left corner of the tablet. OK, enough rambling. I modified the driver to add the following options to XF86Config: SkipFirmware: Causes the driver to skip the firmware test and assume everything is OK. Dimensions X Y: Instead of asking the tablet for its size, the driver will use X and Y as the dimensions. More on this later. That was enough to get the tablet working, but I also added one more option. HasPressure: Causes the driver to assume the tablet is going to send pressure readings from the stylus. That one was a bit trickier, because the Summa driver didn't deal with pressure at all. It also requires you to put the tablet into an undocumented mode. For these reasons, I consider the HasPressure option experimental, and suggest that you only use it if you need it. (If you're using your tablet as core pointer, or in relative mode, or of course if you are using a puck, then you don't need it.) PUTTING YOUR CALCOMP IN SUMMA MODE I can't say for sure that this will be the same on all Calcomp tablets. You should read the appropriate section of your hardware user's guide. In the DrawingSlate II User's Guide you can follow along in chapter 4. 1) Turn on Configuration mode. On a DSII you do this by touching CONF/EXIT on the button strip. The CONFIGURATION LED should turn on. 2) Record all your current settings. The factory defaults are recorded in the manual. If you don't have the manual write them down. If you have a DSII they should be: A 110001111101 B 011101001100 C 000000000001 D 001000000000 Confirm this by touching A[1-12], then moving the pointer over each of the number buttons, and repeating for B, C, and D. The POWER LED says which ones are on. If you have a different tablet maybe they're different. 3) Change the tablet to Summa MM 1201B format. On a DSII, this is mode 30. You enter it with the following switches: A12=ON, B1=ON, B2=ON, B3=ON, B4=OFF. That is, touch the A[1-12] button, then hold the stylus over 12. The power light should be on. If it is off, touch the twelve. Then touch B[1-12], make sure that B1, B2, and B3 are also on, and B4 is off. 4) Turn off Configuration mode. (Touch CONF/EXIT again and the led should turn off.) That's all, assuming that your tablet is still set to the factory defaults. There are a few other minor tweaks that you can do, but that should get you going. Don't save your configuration yet. REPLACE THE SUMMA DRIVER MODULE I will provide a binary of the driver, for XFree86 3.3.x, ELF, libc5. I'll also provide a patch to the source code in case your configuration is different. To use the patch you'll also need a recent XFree86 source tree. If you need to rebuild, here are some steps to build just the Summa module without having to rebuild all of XFree86: 1) Go to your XFree86 source tree, into the XFree86 Common directory. cd /.../xc/programs/Xserver/hw/xfree86/common 2) Apply the patch. patch < ~/.../calcomp.patch 3) Prepare the build environment. export XPROJECTROOT=/.../xc xmkmf 4) Build the new module. No need to rebuild everything. make xf86Summa.so Now, one way or another, you probably have an xf86Summa.so configured for your system. This file goes in /usr/X11/lib/modules, and replaces the file of the same name there. You should back up the old module first, and then copy the new driver over the old one. You'll probably need to do this as root. * DO NOT OVERWRITE MODULES WHILE XFREE86 IS RUNNING * Well, time it doesn't matter much because the module probably isn't loaded. Still, on principle, don't do it. You have to restart X anyway, so you may as well get out now. EDIT YOUR XFREE86 CONFIGURATION Again, you'll probably need to be root. First refer to the man page for XF86Config, and to the HOWTO for XInput. 1) Add xf86Summa.so to the Module section: Section "Module" Load "xf86Summa.so" EndSection 2) In the Xinput section, uncomment the SummaSketch section, and change it so it looks like this: SubSection "SummaSketch" Port "/dev/ttyS0" DeviceName "calcomp" Mode Absolute DebugLevel 9 NoFirmware Dimensions 2500 2000 EndSubSection 3) That was my configuration. Change it to yours. The Port might be ttyS1. It is whatever serial port your tablet is connect to. The Dimensions might be higher. They are 500 times the size in inches. Width, then Height 4) Save the file and exit TEST YOUR CONFIGURATION 1) Start XFree86 (you did stop it when I said, right?) sync; startx The sync is because this _could_ lock your system. 2) Go back to the terminal where you typed startx F1 3) Scribble. You should see lots of debug information from the tablet if it worked. If it didn't your server probably crashed. (Note, pressure isn't enabled yet so the z= part will be zero.) 4) Go back to X F7 5) Try the pointer graphically. xsetpointer calcomp 6) Try relative mode. xsetpointer pointer xsetmode calcomp relative xsetpointer calcomp 7) And so on. So far so good? OK. Those who want to use their tablet as the core pointer can add AlwaysCore to the SummaSketch XInput subsection, and reduce or remove the DebugLevel. Then save your tablet settings. On the other hand, if it didn't work, or if you got a lot of Bad Magic Number reports, then your tablet isn't like mine and I can't help you. WHAT ABOUT PRESSURE? Ah, a kindred spirit. 1) Shut down XFree86 2) Enter configuration mode on your tablet 3) Turn on C5, and exit configuration mode. 4) Add the following to XF86Config XInput SubSection "SummaSketch": HasPressure 5) Restart X and test as before. Now the z= part of the debug information should range from 0 to 128 depending on pressure. 6) Test in gsumi, xink, or the GIMP. You may need to rebuild GTK with XInput support: configure --with-xinput=xfree If everything works, you can reduce the DebugLevel, and save your tablet settings. Again, if it doesn't work, I can't help you. And if it breaks anything, it's not my fault. TO SAVE YOUR TABLET SETTINGS 1) Enter configuration mode Hit CONF/EXIT. The configuration LED should light up. 2) Hit SAVE. It's at the far right of the tablet. 3) Hit CONF/EXIT again. Cheers, Bruce Dodson bruce_dodson@bigfoot.com