Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dkwingsmt
Copy link
Contributor

This PR adds some documentation to PointerChange and PointerDeviceKind.

The relationship between them and the situation for the values have been complicated with the addition of support for trackpad.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@dkwingsmt dkwingsmt marked this pull request as ready for review June 15, 2022 01:26
@dkwingsmt
Copy link
Contributor Author

cc @moffatman

@dkwingsmt
Copy link
Contributor Author

dkwingsmt commented Jun 15, 2022

I've discussed with @/moffatman and verified that the contents are correct.

invertedStylus,

/// A touch-based pointer device with an indirect surface.
/// Gestures from a touch-based pointer device with an indirect surface.

Choose a reason for hiding this comment

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

It would be helpful to explain what's meant by "indirect surface".

Choose a reason for hiding this comment

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

I have the same question.

Copy link
Contributor Author

@dkwingsmt dkwingsmt Jun 16, 2022

Choose a reason for hiding this comment

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

I've changed it to

  /// Gestures from a trackpad.
  ///
  /// A trackpad here is defined as a touch-based pointer device with an
  /// indirect surface (the user operates the screen by touching something that
  /// is not the screen).

Let me know if it makes sense.

/// On supporting platforms, when the user is operating on a physical
/// trackpad, events with kind [trackpad] are dispatched when the user
/// performs gestures on the trackpad, such as panning, zooming, scrolling,
/// or rotating. The [trackpad] kind is only found with [PointerChange] `add`,

Choose a reason for hiding this comment

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

I don't know anything about the class being documented here but: I can't parse the sentence that begins "The [trackpad] kind ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made it into an independent paragraph and rephrased it as follows:

  /// Events with kind [trackpad] can only have a [PointerChange] of `add`,
  /// `remove`, and pan-zoom related values.

Does it make more sense now?

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Thanks for improving the docs!

///
/// When the user is operating with a trackpad on iOS (for example, Magic
/// Keyboard on iPad), clicking will also dispatch events with kind [touch] if
/// `Info.plist` is not present or returns NO for
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think this sounds slightly better but it's up to you, not a big difference.

"or returns" => "or it returns"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for finding this, I actually wrote it wrong. I've changed it to:

  /// [...] if `UIApplicationSupportsIndirectInputEvents` is not present in `Info.plist`
  /// or returns NO.

Does it sound right now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me, thanks!

Copy link

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

A few suggested changes...

invertedStylus,

/// A touch-based pointer device with an indirect surface.
/// Gestures from a touch-based pointer device with an indirect surface.

Choose a reason for hiding this comment

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

I have the same question.

@dkwingsmt
Copy link
Contributor Author

Thank you all for the comments. I think I've addressed all of them. Can you take another look?

houhuayong pushed a commit to houhuayong/engine that referenced this pull request Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants