[X.org] Use your Android tablet as a graphics tablet
Important update: This article is obsolete because there is a new version of the app, including a uinput driver instead of the X.org input driver available here: http://rfc2822.github.com/GfxTablet/
Recently, we have bought an Android tablet for our company. The touch-screen is pressure-sensitive and can be used with a stylus pen. While there are many apps for all kinds of use, I couldn’t find anything that allows me to use the tablet as a graphics tablet for my desktop PC.
So I have decided to make the Android tablet a “graphics tablet”. The drawing data should be transmitted via network (WiFi). Because I use Linux, my choice was to write two pieces of software:
- an Android app that shows a canvas and sends all touch events via network to the PC
- an input driver that receives the data via network and posts them to the operating system / graphics server.
Please note that there is no input driver for Windows, so this won’t work under Windows. I don’t use Windows and therefore don’t plan to write one, but if you are interested in doing so, please tell me.
You can see the virtual network tablet in action here:
http://www.youtube.com/watch?v=QgTm2TEt4Yc (BTW, it’s not me on the video)
Requirements: Android 4.0+, touch-screen (ideally with stylus pen, and ideally large)
How to use:
Just download the XorgTablet .apk file and install it on your phone (make sure that installation of non-Play apps is allowed in Settings / Applications).
- Start the app, choose “Settings”
- Enter a host name or IP address instead of the pre-configured 127.0.0.1.
- Hover and touch events will be sent via UDP to the specified host at port 40117. You may use tcpdump or Wireshark on this port to watch the data.
The X.org input driver: xf86-networktablet How to compile / use: Install the necessary packages for compiling. On my testing machine (I have developed in a VirtualBox) which is running Ubuntu 11.10, I can find git, gcc, libtool, make, xserver-xorg-dev, xtrans-dev, xutils-dev, libx11-dev and many others. Depending on your distribution, you may need other packages, but in any case you will need the X.org development packages. Download the code from Github:
git clone https://github.com/rfc2822/xf86-networktablet.git
Adapt the Makefile, if required. Compile with
make, install with
sudo make install. Now there should be a file called
Add the xf86-networktablet virtual tablet to your X.org configuration. A minimal
/etc/X11/xorg.confwould look like this:
Section "ServerLayout" Identifier "DefaultLayout" InputDevice "NetworkTablet0" EndSection Section "InputDevice" Identifier "NetworkTablet0" Driver "networktablet" EndSection
When you restart your X server, you should be able to see the XorgTablet in the logs, and
xinput listshould show a “NetworkTablet0” device.
Now the virtual tablet listens on 0.0.0.0:40117 for UDP packets. You may now control it via the XorgTablet app.
Using the network tablet with GIMP
You can use the network tablet as a graphics tablet in GIMP, too: Edit / Input Devices / Network tablet / Mode: set to Screen. Now you can draw on your Android tablet and all events will be sent directly to GIMP, including the pressure.