The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
adding wacom tablet support to sdl
Bill Kendrick
Guest

So has anyone looked into actually adding drawing tablet (i.e., Wacom)
support to libSDL at this point? For X11 or otherwise?

Currently, Tux Paint works great with Wacom pad, Tablet PC running WinXP,
etc. It's just that there's no pressure support (since it's only acting
as a regular mouse), and no erase support (since it's only acting as a
mouse).

Thanks :)

-bill!

(Keeping the rest for context, since it's been ~4 months)

On Sat, Nov 04, 2006 at 12:15:26PM +1100, Danni Coy wrote:
Quote:
I have recently finished doing this for an app I am working on....
It is reasonably easy if not that straight forward...

There is a header file called SDL_syswm.h

This has functions necessary to access events from the underlying
windowing system.... Which means you have to use xlib to initiliase
the tablet and get the input...

http://www.bolthole.com/solaris/drivers/xopen.c
is the only example I can find in the wild.


There are several things you must then do

1) enable WM events that SDL does not understand code should look like this...

SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if (( SDL_GetWMInfo(&info) == -1))
{printf("could not get WM Info: %s.\n", SDL_GetError()); use_tablet = 0;}

SDL_EventState(SDL_SYSWMEVENT,SDL_ENABLE);

2) you can now receive wacom events via the SDL_SYSWMEVENT event

remember to use the lock and unlock functions while initialising the Tablet.

Hope that is enough to get you started feel free to ask further questions

_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

--
-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/