We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3386 - No support for Tablet input features
Summary: No support for Tablet input features
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: x86_64 Windows (All)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-07 22:14 UTC by Stefan Murawski
Modified: 2017-08-12 01:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Murawski 2016-07-07 22:14:20 UTC
So I decided to create this feature-request/bug-report, since it seems that this strangely has not been done before.
On Windows, more advanced, say anything other than x/y position and left/right click, is not supported.
To list a few of these feature that might be supported by tablets:
- pressure
- z position (stylus being recognized before touching the surface)
- rotation
- angle
- differentiation between different tips and stylii
and very likely more that I didn't think about.

The, I would guess, most wanted feature would be to get the pressure, this has quite a few potential uses in games and non-game applications. (Painting Programs are a very good example!)

Getting this data on Windows is not really an easy task, there are two major competing apis available.
One is Wintab, which has been created by Wacom which is used by their tablets and (a bit more poorly) by some 3rd Party developers like for example Huion.
This one is, in my opinion, actually the easier to use one, you can get some results rather quickly and examples are a bit more common since this has been around for quite some time.

The other way to get this data would be from Microsofts APIs, for SDL it seems that the RealTimeStylus Interface would be the most useful one.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms701683(v=vs.85).aspx

Anders Ekermo, has created a blog post 3 years ago about this, and has even posted a working example using SDL and the RealTimeStylus Interface.
http://backworlds.com/under-pressure/

While it's good to know that this works and that someone could use that example to add tablet support to his program, this is not a really clean or intuitive solution and it also won't translate into SDL Ports for other languages.
So, if SDL would support this directly someone using PySDL would be able to simply get the same inputs from tablets without having to bash their head open trying to speak to the RealTimeStylus Interface.
(Silently raises hand, Microsofts APIs are really confusing, even more if you want to use them from a not supported language like python.)

So in short: Please support the RealTimeStylus Interface so we can create more SDL programs with pressure support, thanks.
Comment 1 Sam Lantinga 2017-08-12 01:13:33 UTC
This is good feedback for SDL 2.1, thanks!