chore!: Kill legacy Force Press event API - #3989
Open
luanpotter wants to merge 1 commit into
Open
Conversation
luanpotter
marked this pull request as ready for review
August 7, 2026 13:19
Member
Author
|
Replacing #3986 - killing it instead |
6 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Removes Flame’s legacy game-level Force Press gesture API (ForcePressDetector/ForcePressInfo) and all associated wiring, reflecting the near-total lack of Force Touch hardware support and reducing public surface area ahead of the next major migration.
Changes:
- Removed
ForcePressDetectormixin andForcePressInfoevent wrapper from the gestures API. - Removed Force Press recognizer registration from
GameWidgetgesture setup and related hit-test plumbing. - Removed Force Press tests and updated documentation (migration + gesture input docs) to reflect the removal.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/flame/test/gestures/detectors_test.dart | Removes Force Press detector tests and the dedicated test game. |
| packages/flame/lib/src/gestures/events.dart | Removes ForcePressInfo event wrapper type. |
| packages/flame/lib/src/gestures/detectors.dart | Removes ForcePressDetector mixin and its handler methods. |
| packages/flame/lib/src/game/game_widget/gesture_detector_builder.dart | Removes Force Press gesture recognizer registration for games. |
| packages/flame/lib/src/game/flame_game.dart | Removes Force Press from the “gesture-detectors imply full-surface hit” logic. |
| packages/flame/lib/events.dart | Stops exporting ForcePressDetector and ForcePressInfo from the public events barrel. |
| doc/flame/migration.md | Adds migration guidance about the removal and Flutter-level alternative. |
| doc/flame/inputs/gesture_input.md | Removes ForcePressDetector from the documented detectors list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Kill legacy Force Press event API, with no replacement.
It was a niche API, only available on some older Apple's 3D Touch devices; the iPhone XS and XS Max (2018) were the last models to include it (see Apple's Models with 3D Touch, a list that Apple even stopped carrying forward after the iOS 14 guide). Every iPhone since, starting with the XR, uses Haptic Touch, which responds to how long a press lasts rather than how hard it is, and so never produces these callbacks. Only a handful of Android devices ever supported it, and some of those (such as the Pixel 2 and 3) have faux pressure sensors that never fired the callbacks anyway.
Combined with force press being the last gesture without an equivalent on the component-level event system, maintaining it was no longer worth the surface area.
If you do still target a 3D Touch device, the gesture remains fully available from Flutter: wrap your
GameWidgetin aGestureDetectorand use itsonForcePressStart,onForcePressPeak,onForcePressUpdateandonForcePressEndcallbacks directly.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?