Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve triggering of touch event and introduce Eraser device #1293

Open
wants to merge 9 commits into
base: release/2.x
Choose a base branch
from

Conversation

skarllot
Copy link

@skarllot skarllot commented May 16, 2020

Description of Changes

  • Capture touch pressure for Mac, UWP and iOS.
  • Capture wheel delta for Mac.
  • Support touch and stylus on WPF platform.
  • Support mouse on Android platform.
  • Introduce Eraser device.
  • Add a TO-DO for Tizen where device ID is buggy.

API Changes

Added:

  • Eraser member for SKTouchDeviceType enum.
  • Constructor .ctor(long, SKTouchAction, SKPoint, bool, float) for SKTouchEventArgs class.

Behavioral Changes

  • Android triggers Pressed, Up and Cancel events for all pointers instead of triggering just for Moved event.
  • When Stylus pen is inverted trigger touch event as Eraser device.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Updated documentation

@msftclas
Copy link

msftclas commented May 16, 2020

CLA assistant check
All CLA requirements met.

Pepsi1x1
Pepsi1x1 previously approved these changes May 29, 2020
@mattleibow mattleibow added this to In progress in v2.80.0 via automation Jun 10, 2020
@mattleibow mattleibow added this to In progress in v2.80.x via automation Jun 11, 2020
@mattleibow mattleibow removed this from In progress in v2.80.0 Jun 11, 2020
@mattleibow
Copy link
Contributor

Thanks for this PR. Sorry it took so long to get to it.

Base automatically changed from master to main February 5, 2021 08:30
@mattleibow mattleibow added this to In progress in v2.88.x Jul 12, 2021
@mattleibow mattleibow added this to the v2.88.1 milestone May 22, 2022
@skarllot
Copy link
Author

Should I close this PR? After 2 years I think that it will not be merged anymore

@mattleibow mattleibow modified the milestones: v2.88.1, v2.88.x Planning Sep 11, 2022
@nshtinkov
Copy link

Is this still planned? It would fix #1814 and the Eraser addition is also quite needed.

Being able to detect pen pressure on Windows is essential, and it is a one-line fix. If this pull request is not getting further attention, I can make a new one that will fix at least the pressure issue.

@mattleibow mattleibow changed the base branch from main to release/2.x April 28, 2024 01:45
@mattleibow
Copy link
Contributor

/rebase


var wheelDelta = pointerPoint?.Properties?.MouseWheelDelta ?? 0;
var pressure = pointerPoint?.Properties?.Pressure ?? 0.5;
Copy link

@nshtinkov nshtinkov Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 133 should be ?? 1 because 1 is the default pressure for SKTouchEventArgs. Also this change would fix the compiler error.
pr1239fix.patch

Copy link

@nshtinkov nshtinkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in my comment above, the attached one-line patch is required to fix the build and ensure that pressure handling is consistent across platforms and devices (i.e. use a default value of 1).
pr1239fix.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
v2.80.x
  
In progress
v2.88.x
In progress
Development

Successfully merging this pull request may close these issues.

None yet

5 participants