Differentiate between direct and indirect pen types on Windows #6539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This uses the
GetSystemMetrics(SM_DIGITIZER)
win32 API to get whether any connected tablets/pens are direct (NID_INTEGRATED_PEN
) or indirect (NID_EXTERNAL_PEN
).The SDL code is modified to support reporting
TabletPenDeviceType
on a per-pen basis. This ensures that a pen type can't change while it's active, which would result in touches or left click getting stuck when using multiple pens at the same time.Using multiple pens at the same time is not supported (the different pens will fight for the same cursor position), but at least it won't ever get inputs stuck.
Testing
On @Walavouchey's Microsoft Surface, the API returns, among other unrelated values,
NID_INTEGRATED_PEN
(discord).My Wacom Intuos CTL-6100WL, with and without windows ink enabled in driver settings, is reported as both
NID_INTEGRATED_PEN
andNID_EXTERNAL_PEN
. Which is a bit unexpected, but we can work with it.The newly-added code paths aren't used with in-game OTD or with external OTD in default settings.
This may affect OTD with the windows ink plugin, but I would expect it to behave similar to the real wacom tablet, as it creates a virtual HID device.