JibbSmart / JoyShockLibrary

Read DualSense, DualShock 4, JoyCon, and Pro Controller input on PC -- compiled for Windows, but code should work on other platforms.
Other
240 stars 48 forks source link

Expand on touch callback to report relative movement in raw unit. #18

Closed Electronicks closed 3 years ago

Electronicks commented 4 years ago

From Discord:

Currently, I get 2 touch points and their absolute location in percentage. This works great for buttons, but if I want to do a cursor mode, I'm going to need the "raw" movement value, not the percentage. Biggest reason for this need is so not to warp the trackpad space since it is not square. Now, to make it device agnostic (with the foresight of steam controller support for example) percentage is proper, so I was thinking in addition to what it currently holds, the structure could also contain the raw displacement. That would make the information independent from the pad's resolution or shape.

Other line of thought was whether we would want the callback to scale better with the number of touchpoints. DS4 and SC really have 2, but could/should we plan to support a scalable amount? Something like VR controllers would support a touchpoint on every finger. This implementation has both touch point as individual parameters.

Electronicks commented 3 years ago

Pull Request has been updated for the DualSense addition.

Electronicks commented 3 years ago

Changing strategy to minimize changes