- Joined
- Jun 20, 2001
- Location
- Vancouver, WA
If anybody here has a Wacom tablet (or any tablet really), I was wondering if you'd be interested in testing something for me. I've been working off and on for a while porting the JTablet library to Linux. JTablet provides Java applications and applets with support for tablets, making it possible for them to determine pen pressure and other attributes.
Note: A Trac wiki & SVN repository for this project is up and available at http://localhostlabs.no-ip.org/jtablet/ -- feel free to drop by or checkout files
x86 Debian/Ubuntu Instructions
~~~~~~~~~~~~~~~~~~~~~~~~
Begining with 0.9.5.2.1 Debian and Ubuntu users should be able to install JTablet Linux from a simple DEB package. This greatly reduces the work required to install since the package will search for and install all other required packages for you. To install, simply download the attached DEB package and run the following command:
If you'd like to remove JTablet at a later date, removing it is as simple as running:
Other x86 Linux Distros
~~~~~~~~~~~~~~~~~~~~~~~~
Users of other distros which do not wish (or unable to) compile from source may be able to make use of the binary installer. This version installs the pre-compiled library onto your system. However, for the library to work you will need to be sure your system satisfies a few requirements:
To install the binaries, extract the .zip file to a location of your choosing. From within that dirctory, run the following command as root:
If you ever want to uninstall the binaries, run the following command as root:
Compiling From Source
~~~~~~~~~~~~~~~~~~~~~~~~
For those who are not able (or do not wish to) install one of the provided binary versions can compile the project from source by following the instructions below.
Prior to compiling, there are a number of requirements that must be satisfied:
To compile the source, download the attached .zip file and extract the files. Open up a terminal and change to the location you extracted. Run the following command:
Once compiled, the resulting library and JAR may be installed by running the following as root:
If you want to uninstall the library and JAR, run the following as root:
Testing
~~~~~~~~~~~~~~~~~~~~~~~~
Only the source package includes examples that can be run. If you built from source you can run any of the following commands from the project's root:
The first command runs an applet which provides a canvas that you can draw on. It should respond to pressure by varying the stroke width. The second command displays real-time details about the tablet (such as position, pressure, and [if supported] pen angle). The final command is the same as the second, but runs as a Java application instead of an applet -- try this if the first two do not run.
If you have not installed from source, you will need to try to run a JTablet-enabled applet online. The following is a list of sites that have JTablet-enabled applets:
Troubleshooting
~~~~~~~~~~~~~~~~~~~~~~~~
When troubleshooting problems, it is important that you provide the console output. This is easy for compiling/installation problems, as you are typically already working at the console. If having problems with applets online, open up the browser through the console (e.g., by running the command "firefox" from the console) to view the library's output.
Debugging messages are enabled by default on the binary distributions provided, though not enabled by default when compiling from source. To enable debugging for the compiled version, you can rebuild the files like this:
This will clean out all the compiled code and then rebuild it with debugging enabled. After it is built, the old version is uninstalled and the new version installed in its place.
Also, screenshots are useful, as well as some OS information. Posting the distro, X.Org version, LinuxWacom driver version, etc are a great help if you know them
Version History
~~~~~~~~~~~~~~~~~~~~~~~~
2007-10-27: Fixed a bug with the button mask & mapped all available axes (even though I've yet to come up with a good way to determine if the tablet actually supports them...). Created an abstract TabletDevice superclass which xtabletaccess.cpp interfaces with (rather than directly with WacomDevice).
2007-10-29: Modified makefiles to use the $JAVA_HOME and $JDK_HOME environment variables. This should result in more portable code (since those variables should be present on way more systems than the java-config command I'd been using) but will break if you attempt to "sudo" the install or uninstall commands (since environment variables like $JAVA_HOME are not passed in by sudo to the command )
2007-11-05: Fixed an error in the refactoring I did on 2007-10-27, fixed some stuff to make it compile under Ubuntu Gutsy. Good luck with the compiling
2008-01-13: Modified xtablet to make use of device names rather than device IDs to allow for better tablet detection (since IDs aren't constant between systems ). Also, adapted the event registration code from JPen since it was working for henke_a.
2008-01-25: After going through the code again, I've realized my problem with catching events wasn't in event registration, but rather in determining the "owner" of an event. Simply, I had misread the X11 API and was looking for the wrong device ID. It was only through sheer luck that the last version worked on my Gentoo install. I've installed Ubuntu Gutsy on my desktop, and this latest version is working under it, so I have high hopes...
2008-03-30: Modified the structure of the package quite a bit from the previous version. Win32 and X11 builds are seperated into their own subdirectories (only the common files are left in the root), classes now have associated .h files, makefiles have been modified, etc. I've also unified debug statements across all the files, and am littering them in more and more places. This version also hopefully fixes an issue with X.Org 7.3 "XExtensionPointer" devices which weren't being recognized (and temporarily ignores all extension device test results while I debug).
2008-04-06: Fixed the code which reported the stylus tilt to give altitutde/azimuth values (as required by the jTablet library) rather than x-tilt/y-tilt values (as reported from the LinuxWacom driver).
2008-05-14: Re-wrote the math powering the altitude/azumith code. Hopefully this time it returns real values
2008-05-19: Changed the SupportsAxis method to check that the requested axis number is less than the number of axes supported by the tablet. This should keep non-Wacom tablets which use the same axis numbering scheme from crashing when JTablet requests a non-existant axis.
2008-06-10: Removed some files from the examples directory which caused incorrect error messages when files have not been properly installed. Also allowed compatibility check to allow devices that start with "Tablet" or "Wizardpen" (the two common prefixes for Wizardpen device names).
2008-06-18: Overhauled the logging system to make use of a static Log class instead of the #define hacks I was using. Also included a new log message to notify about events which are taken from the event queue but never acted on.
2008-06-25: Added in a missing #include found by tetromino. Changed compatibility verification code which checks tablet names to warn on unknown names instead of fail.
2008-07-08: Included NULL pointer checking and warning in XWacomDevice::GetEventType, since that is where the pen-down crash occurs. I've not pinned down the cause, so hopefully these new warnings will be sufficient to let me figure out what is going wrong. ALSO changed version number scheme for better use with my SVN server. I hope to eventually put a link to my SVN & Trac server to provide access to all the versions and a ticketing system.
2008-07-11: Fixed three bugs. 1) Log was not displaying WARN level entries. 2) Compatibility check did not reject virtual devices. 3) Inaccessible devices would create half-initialized objects.
2009-01-01: Happy New Year! There are a number of changes in this release, mostly related to installation. I've figured out a better spot to install the .so and .jar files (which should work across all distros), and have also managed to find instructions on creating DEB packages (so that Debian/Ubuntu users need not compile anything!). Also, compilations will NOT by default be debug versions anymore. Instructions on creating debug versions are included above.
Note: A Trac wiki & SVN repository for this project is up and available at http://localhostlabs.no-ip.org/jtablet/ -- feel free to drop by or checkout files
x86 Debian/Ubuntu Instructions
~~~~~~~~~~~~~~~~~~~~~~~~
Begining with 0.9.5.2.1 Debian and Ubuntu users should be able to install JTablet Linux from a simple DEB package. This greatly reduces the work required to install since the package will search for and install all other required packages for you. To install, simply download the attached DEB package and run the following command:
Code:
# dpkg -i jtablet_20090101-1_i386.deb
If you'd like to remove JTablet at a later date, removing it is as simple as running:
Code:
# dpkg -r jtablet
Other x86 Linux Distros
~~~~~~~~~~~~~~~~~~~~~~~~
Users of other distros which do not wish (or unable to) compile from source may be able to make use of the binary installer. This version installs the pre-compiled library onto your system. However, for the library to work you will need to be sure your system satisfies a few requirements:
- A Java VM (only tested with Java 6, very likely works with others)
- Sun Java 6 JRE
- X11 Development Libraries
- libX11
- libXi
- libXau
- libXdmcp
- libXext
- C Library
- libc
- Standard C++ Library
- libstdc++
To install the binaries, extract the .zip file to a location of your choosing. From within that dirctory, run the following command as root:
Code:
# make install
If you ever want to uninstall the binaries, run the following command as root:
Code:
# make uninstall
Compiling From Source
~~~~~~~~~~~~~~~~~~~~~~~~
For those who are not able (or do not wish to) install one of the provided binary versions can compile the project from source by following the instructions below.
Prior to compiling, there are a number of requirements that must be satisfied:
- Java Compiler (only tested with Java 6, very likely works with others)
- Sun Java 6 JDK
- JDK_HOME set properly (installing Sun Java does not do this! a command similar to the following must be run if JDK_HOME has not been defined)
- export JDK_HOME="/usr/lib/jvm/java-6-sun/"
- C++ Compiler
- g++
- X11 Development Headers
- libx11-dev (X11 client-side library development headers)
- x11proto-core-dev (X11 core wire protocol and auxiliary headers)
- x11proto-input-dev (X11 Input extension wire protocol)
- libXi-dev (X11 Input extension library (development headers))
To compile the source, download the attached .zip file and extract the files. Open up a terminal and change to the location you extracted. Run the following command:
Code:
$ make
Once compiled, the resulting library and JAR may be installed by running the following as root:
Code:
# make install
If you want to uninstall the library and JAR, run the following as root:
Code:
# make uninstall
Testing
~~~~~~~~~~~~~~~~~~~~~~~~
Only the source package includes examples that can be run. If you built from source you can run any of the following commands from the project's root:
Code:
$ make test
Code:
$ make test2
Code:
$ make test3
The first command runs an applet which provides a canvas that you can draw on. It should respond to pressure by varying the stroke width. The second command displays real-time details about the tablet (such as position, pressure, and [if supported] pen angle). The final command is the same as the second, but runs as a Java application instead of an applet -- try this if the first two do not run.
If you have not installed from source, you will need to try to run a JTablet-enabled applet online. The following is a list of sites that have JTablet-enabled applets:
- http://sketchstudio.cellosoft.com/jtablet-test/
- The same applet as run by "make test" above
- http://2draw.net/
- Sign up for an account & use the "DRAW" button near the top
- http://artgrounds.com/
- Sign up for an account & use the "Sketcher" button near the top
Troubleshooting
~~~~~~~~~~~~~~~~~~~~~~~~
When troubleshooting problems, it is important that you provide the console output. This is easy for compiling/installation problems, as you are typically already working at the console. If having problems with applets online, open up the browser through the console (e.g., by running the command "firefox" from the console) to view the library's output.
Debugging messages are enabled by default on the binary distributions provided, though not enabled by default when compiling from source. To enable debugging for the compiled version, you can rebuild the files like this:
Code:
$ make clean
$ make DEBUG=1
$ su
# make uninstall
# make install
This will clean out all the compiled code and then rebuild it with debugging enabled. After it is built, the old version is uninstalled and the new version installed in its place.
Also, screenshots are useful, as well as some OS information. Posting the distro, X.Org version, LinuxWacom driver version, etc are a great help if you know them
Version History
~~~~~~~~~~~~~~~~~~~~~~~~
2007-10-27: Fixed a bug with the button mask & mapped all available axes (even though I've yet to come up with a good way to determine if the tablet actually supports them...). Created an abstract TabletDevice superclass which xtabletaccess.cpp interfaces with (rather than directly with WacomDevice).
2007-10-29: Modified makefiles to use the $JAVA_HOME and $JDK_HOME environment variables. This should result in more portable code (since those variables should be present on way more systems than the java-config command I'd been using) but will break if you attempt to "sudo" the install or uninstall commands (since environment variables like $JAVA_HOME are not passed in by sudo to the command )
2007-11-05: Fixed an error in the refactoring I did on 2007-10-27, fixed some stuff to make it compile under Ubuntu Gutsy. Good luck with the compiling
2008-01-13: Modified xtablet to make use of device names rather than device IDs to allow for better tablet detection (since IDs aren't constant between systems ). Also, adapted the event registration code from JPen since it was working for henke_a.
2008-01-25: After going through the code again, I've realized my problem with catching events wasn't in event registration, but rather in determining the "owner" of an event. Simply, I had misread the X11 API and was looking for the wrong device ID. It was only through sheer luck that the last version worked on my Gentoo install. I've installed Ubuntu Gutsy on my desktop, and this latest version is working under it, so I have high hopes...
2008-03-30: Modified the structure of the package quite a bit from the previous version. Win32 and X11 builds are seperated into their own subdirectories (only the common files are left in the root), classes now have associated .h files, makefiles have been modified, etc. I've also unified debug statements across all the files, and am littering them in more and more places. This version also hopefully fixes an issue with X.Org 7.3 "XExtensionPointer" devices which weren't being recognized (and temporarily ignores all extension device test results while I debug).
2008-04-06: Fixed the code which reported the stylus tilt to give altitutde/azimuth values (as required by the jTablet library) rather than x-tilt/y-tilt values (as reported from the LinuxWacom driver).
2008-05-14: Re-wrote the math powering the altitude/azumith code. Hopefully this time it returns real values
2008-05-19: Changed the SupportsAxis method to check that the requested axis number is less than the number of axes supported by the tablet. This should keep non-Wacom tablets which use the same axis numbering scheme from crashing when JTablet requests a non-existant axis.
2008-06-10: Removed some files from the examples directory which caused incorrect error messages when files have not been properly installed. Also allowed compatibility check to allow devices that start with "Tablet" or "Wizardpen" (the two common prefixes for Wizardpen device names).
2008-06-18: Overhauled the logging system to make use of a static Log class instead of the #define hacks I was using. Also included a new log message to notify about events which are taken from the event queue but never acted on.
2008-06-25: Added in a missing #include found by tetromino. Changed compatibility verification code which checks tablet names to warn on unknown names instead of fail.
2008-07-08: Included NULL pointer checking and warning in XWacomDevice::GetEventType, since that is where the pen-down crash occurs. I've not pinned down the cause, so hopefully these new warnings will be sufficient to let me figure out what is going wrong. ALSO changed version number scheme for better use with my SVN server. I hope to eventually put a link to my SVN & Trac server to provide access to all the versions and a ticketing system.
2008-07-11: Fixed three bugs. 1) Log was not displaying WARN level entries. 2) Compatibility check did not reject virtual devices. 3) Inaccessible devices would create half-initialized objects.
2009-01-01: Happy New Year! There are a number of changes in this release, mostly related to installation. I've figured out a better spot to install the .so and .jar files (which should work across all distros), and have also managed to find instructions on creating DEB packages (so that Debian/Ubuntu users need not compile anything!). Also, compilations will NOT by default be debug versions anymore. Instructions on creating debug versions are included above.
Attachments
Last edited: