Introduction and Other Easy Things
I recently bought a Thinkpad X41 tablet cheap off eBay. And, because it's the kind of thing I do, I promptly set to work installing the latest release of Ubuntu (9.04, Jaunty Jackalope) on it. Since the X41t doesn't have an optical drive, I installed via LiveUSB. The USB can easily be created from an existing Ubuntu install or LiveCD using the included USB Startup Disk Creator (System -> Administration -> USB Startup Disk Creator), or from Windows via instructions like these or these.
I won't trouble you with installation instructions, because the installer is well set up, the Ubuntu Installation Guide is very good, and I didn't have to do anything special to get it working. Installation took about 15 minutes (seriously: very fast), and afterwards it took about 30 seconds to go from GRUB to the login screen.
I'm happy to say that basically everything worked out of the box - including the wireless card and basic tablet functionality. For handwriting recognition, I used Synaptic to install the equivalent of Windows XP's Tablet Input Panel, Cellwriter. And, because it's useful, I installed a Windows Journal equivalent, Xournal.
Two things did not work right away: the tablet hardware buttons (including special PageUp and PageDown keys, a screen rotation button, and a few others), and (since there was no button for it) any kind of screen rotation that didn't involve going through the control panels. The volume keys work, but apparently control the hardware volume level (as distinct from the software volume level set in the Sound control panel), and therefore have no on-screen display.
My key resources for getting these things working were LIKEN Apuntes's Installing Linux, Ubuntu 8.04 Hardy, on a IBM X41 Tablet and Thinkwiki.org, which is a staggeringly good resource for getting Linux to work on Thinkpads.
Tablet Keys
Tablet keys were not actually difficult to make work, but took me a long time because Thinkwiki was down. My understanding of the problem is this: every keypress generates a hexadecimal key scancode in the kernel, which is then passed to X and assigned a separate keycode from 0 to 255. Keycodes from 0-119 are used for standard keyboard keys, and keycodes 120 and above are mostly unused. Once you find the keycodes the kernel uses, it's a trivial matter to find set a keycode in X and assign shortcuts to it. Unfortunately, in 9.04, the kernel's keyboard mask is set to disregard those buttons entirely, making it very difficult to find those keycodes.
Fortunately, though, Thinkwiki has an article on Tablet Hardware Buttons. Armed with these keycodes, I needed only edit my /etc/rc.local (sudo gedit /etc/rc.local) to assign those keys codes in X at startup. The keycodes for the tablet PageUp, PageDown, Enter, and Escape buttons aren't arbitrary: they're the same ones used by the normal PageUp, PageDown, Enter, and Escape keys. For those, add these lines to /etc/rc.local:
# PageDown, PageUp, Enter, Escape
setkeycodes 6e 109
setkeycodes 6d 104
setkeycodes 69 28
setkeycodes 6b 1
...where 6e, 6d, 69, and 6b are the kernel scancodes in the Thinkwiki article I linked, minus the '0x', and 109, 104, 28, and 1 are the keycodes X uses for PageDown, PageUp, Enter, Escape. If you're interested, you can find out what keycode X uses for what key by entering "sudo dumpkeys" (or, since the output is very long, "sudo dumpkeys | less") into the terminal. Sorry if that's a little over-deliberate.
For the other three keys, you can assign keycodes fairly arbitrarily. All the unused keycodes will be at the end of the dumpkeys output; I used 130, 131, and 132 for the Tablet Menu, Rotate, and Ctrl-Alt-Del keys:
# Tablet Menu Key
setkeycodes 68 130
# Tablet Rotate
setkeycodes 6c 131
# Tablet Ctrl-Alt-Del Key
setkeycodes 67 132
These keys are a little trickier, though, because they don't do anything by themselves. I wanted to assign my Tablet Menu key to open up Cellwriter, so I went to System -> Settings -> Keyboard Shortcuts, hit the "Add" button at the bottom, created a "Cellwriter" shortcut which called on the cellwriter command. Then, I clicked the shortcut box and pressed the Tablet Menu key, and the name X uses for that keycode showed up in the box. Unfortunately, when I was done with that, my Tablet Menu key still didn't do anything.
As a workaround, I went to the configuration editor (gconf-editor in terminal) and from there to apps -> metacity -> keybinding_commands. I arbitrarily assigned command_11 to cellwriter, then went to apps -> metacity -> global_keybindings and assigned run_command_11 to the name the Keyboard Shortcuts control panel gave when I pressed the Tablet Menu key. This is incredibly clumsy, but it worked for me.
I left the Ctrl-Alt-Del key alone, because I couldn't think of anything I wanted to do with it. The Tablet Rotate key requires some extra work.
Tablet Rotation
LIKEN Apuntes has a script and very good directions for setting up your tablet screen to rotate. You can even make the screen rotate automatically when it swivels. If you follow those directions, your tablet will screen will rotate automatically, and you can use gconf-editor to assign, say, command_12 to /usr/local/bin/rotatetablet, and run_command_12 to whatever name Keyboard Shortcuts gives you for your Tablet Rotate key.
There is a problem with this. Your screen will rotate, but the tablet input will not, making pen use awkward at best. This is because of a change in the way Ubuntu Jaunty interprets tablet input. Never fear; there is a fix. I've taken it directly from post 104 of this thread on the Ubuntu forums. Without further ado, run:
sudo gedit /etc/init.d/wacomtohal
and paste in these lines:
#! /bin/sh
## find any wacom devices
for udi in `hal-find-by-property --key input.x11_driver --string wacom`
do
type=`hal-get-property --udi $udi --key input.x11_options.Type`
## rewrite the names that the Xserver will use
hal-set-property --udi $udi --key info.product --string $type
done
Save it, close it, and run these two commands in terminal:
sudo chmod +x /etc/init.d/wacomtohal
sudo update-rc.d wacomtohal defaults 27
After you've done that, restart and everything should work just fine.
Conclusion
Tablet PC support in Linux obviously isn't great, but with a little work the tablet can be made to do everything you'd expect from Windows XP Tablet Edition. Cellwriter and Xournal aren't as good as the Tablet Input Panel and Windows Journal (Cellwriter's handwriting recognition is fairly rudimentary, and Xournal doesn't have it at all), but Ubuntu is snappy on the X41t, and even snappier if you switch (as I did) from the default Gnome desktop environment to Xfce - a simple matter of installing xfce-4 in Synaptic, going to Options -> Select Session and selecting Xfce. It'll even ask you if you want to make it default.
Overall, I'm very happy with the tablet functionality - handwriting recognition isn't something I care much about, since any serious input I do will be through the keyboard anyway. Inking in Xournal is perfectly satisfactory for notetaking, and the ability to annotate PDFs is a nice feature. My only complaint is that Flash videos (from YouTube and Hulu, mostly) are choppy in fullscreen or HD under Ubuntu. This is not the machine's fault, though, or even Ubuntu's - Flash videos run fine in Windows, and higher-definition video formats run fine in Ubuntu using VLC or MPlayer. The fault lies entirely at the door of Adobe's poor Flash implementation in Linux.
That's it - it works.
03 May 2009
The Rating System
All reviews are done out of four stars. One star is bad, two is OK, three is good, and four is basically perfect. Two and a half is pretty good; three and a half is great.
"Baseline" reviews are works that everyone knows, or ought to - to give you an idea of where you disagree with me, and what I mean when I say 3.5 stars.
"Baseline" reviews are works that everyone knows, or ought to - to give you an idea of where you disagree with me, and what I mean when I say 3.5 stars.
Subscribe to:
Posts (Atom)