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
Stylus pressure support?
BarkyTheDog


Joined: 18 Jul 2014
Posts: 1
Greetings -

I'm working for a gent with a cross-platform desktop app that uses SDL for creating windows and getting events. We'd like to support stylus pressure, for our users with Wacom tablets. Web-searching revealed various folks' wishes for support for this in SDL, going back a number of years. So, I'd guess this may be a rehash of an old topic? My apologies...

I grabbed a copy of the latest SDL sources, and studied the API & implementation. As an experiment, I simply added "pressure" to several mouse-related event structs and various methods/functions; on OS X, it's trivial to get pressure info from an NSEvent, and I just fed that into my "enhanced" version. Works like a charm...probably missed a thing or two, owing to my naiveté with SDL, but it should serve for the narrow purposes it serves in the app in question...

In any case, might one inquire as to why there is no stylus pressure (and tilt, etc.) in SDL at this point? I support planned in the future? Seems it's been asked for by some number of folks. As well, I was unable to determine a solution (at least for OS X) that would allow me to obtain stylus info, within the confines of a Cocoa app that uses SDL for handling events. If someone reading this knows some scheme that would get pressure (etc) data, without hacking SDL sources, I'd be all ears :-)

Thanks, and sorry again if this is a worn-out topic... :-)