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

Winit apple pen #3763

Conversation

ActuallyHappening
Copy link

@ActuallyHappening ActuallyHappening commented Jun 28, 2024

Implements #3759
Also see #99

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

I split the implementation and documentation into seperate commits, because I don't know if for the branch I am targeting the way I have updated the change-log is valid and expect to be corrected. (I've written the change under the heading 0.30.4 even though that version hasn't been released yet, since the unreleased.md was empty on the v0.30.x branch but populated on the master branch)

I have tested these changes on my iPad and they work exactly as expected. In an ideal world, I would like this to be released on crates.io in a way that bevy could integrate so I could use it in my bevy application (tracking issue), which is why I was working off the v0.30.x branch so I could seamlessly patch.

Also, the public API I have chosen seems reasonable to me but I am totally open to it being tweaked or re-worked. But I would ideally want this functionality exposed in some way without me having to maintain my own fork as bevy releases roll around. I have intentionally included #[non_exhaustive] in places that I or other developers may add or improve features to. Notably, this PR only handles pen double tap events since that is all I can physically test with my current hardware, but newer Apple Pencil models support squeeze actions that I know (theoretically) how to implement but haven't. The API intentionally allows for this addition later.
The public API I added is also intended to be extendable by other platform implementations, but again I can't test them physically so haven't included here. Each section has ## Platform Specific \n - iOS only documentation for that reason.

This is my first contribution to winit (and my first major feature contribution in general using Open Source) so please tell me if I've done anything wrong! And thanks so much for this awesome crate, contributing to it has taught me a lot about objc2, UIKit and iOS development!

@kchibisov
Copy link
Member

You must always target the master. Though, you could still provide with a backport patch once the master implementation is available.

@kchibisov
Copy link
Member

Oh, also, you can not target 0.30 branch, because you're adding breaking changes, thus they can not be a part of the patch release.

@ActuallyHappening
Copy link
Author

OK, so if I understand correctly this change since it adds new API surface and so can't are released as a patch version 0.30.4.
I'll have to make a new PR I presume adding this functionality to the master branch then, and I think I'll change the naming to PenSpecialAction, see #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants