Repository navigation
Fix eraser end not erasing - #5
Merged
Merged
Conversation
The pen reports eraser contact via the Eraser status bit (bit 3), not Tip Switch (bit 0). EventEmitter only checked tipDown, so flipping the pen switched apps to the eraser tool (via the proximity event) but pressing never produced a mouse-down, and nothing was erased. Contact is now tipDown || eraser for the down/drag/up state machine and the tablet button mask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Flipping the pen to the eraser end changed the cursor in Clip Studio Paint, but pressing down didn't erase.
Cause
The pen reports eraser contact on the Eraser status bit (bit 3), not Tip Switch (bit 0).
EventEmitteronly looked attipDown. The proximity event already said "eraser" (pointer type 3), so apps switched tools, but a press with the eraser end never sent a mouse-down.Fix
EventEmitternow countstipDown || eraseras contact for mouse down/drag/up and for bit 0 of the tablet button mask. Pressure is sent the same way as for the tip.Testing
swift test: 43 tests pass. New testtestEraserContactIsAClickchecks that an eraser press sends down, drag and up, with eraser pointer type, pressure and button bit 0.🤖 Generated with Claude Code