Skip to content

Fixes IOHIDEvent/UITouch phase mismatch that causes some games - #223

Merged
JoseMoreville merged 4 commits into
PlayCover:masterfrom
DaDaweiZhou:master
Aug 12, 2026
Merged

Fixes IOHIDEvent/UITouch phase mismatch that causes some games#223
JoseMoreville merged 4 commits into
PlayCover:masterfrom
DaDaweiZhou:master

Conversation

@DaDaweiZhou

Copy link
Copy Markdown
Contributor
  • Rebuild IOHIDEvent in setPhaseAndUpdateTimestamp: so eventMask stays in sync with UITouch.phase (was only set on touch creation)
  • Fix kif_IOHIDEventWithTouches eventMask for ended/cancelled phases
  • Use per-finger timestamps for more realistic HID events

Some games validate that IOHIDEvent properties match the current UITouch phase. Without this fix, moved/ended touches carry a stale began-phase IOHIDEvent, triggering detection.

- Rebuild IOHIDEvent in setPhaseAndUpdateTimestamp: so eventMask
  stays in sync with UITouch.phase (was only set on touch creation)
- Fix kif_IOHIDEventWithTouches eventMask for ended/cancelled phases
- Use per-finger timestamps for more realistic HID events

Some games validate that IOHIDEvent properties match the current
UITouch phase. Without this fix, moved/ended touches carry a stale
began-phase IOHIDEvent, triggering detection.
@TheMoonThatRises

Copy link
Copy Markdown
Member

Can the comments for handEvent and fingerEvent be added back for parameter clarity?

@DaDaweiZhou

Copy link
Copy Markdown
Contributor Author

@TheMoonThatRises Thanks for your comments, fix already.

Comment thread PlayTools/Controls/PTFakeTouch/Additions/IOHIDEvent+KIF.m
@DaDaweiZhou

Copy link
Copy Markdown
Contributor Author

@TheMoonThatRises Both comments are addressed now. Could you take another look? Thanks!

@TheMoonThatRises
TheMoonThatRises self-requested a review June 28, 2026 05:59
@TheMoonThatRises TheMoonThatRises added the enhancement New feature or request label Aug 12, 2026

@JoseMoreville JoseMoreville left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems fine, just a better logic behind. This potentially solves some game issues

@JoseMoreville
JoseMoreville merged commit ed85128 into PlayCover:master Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants