Commit cb86eb2
28 thumb bug (#29)
* feat: add ModifierKeyType enum and palm rejection preferences
- Add ModifierKeyType enum with shift/control/option/command
- Add exclusion zone preferences (enabled, size)
- Add modifier key preferences (requireKey, keyType)
- Add contact size filter preferences (enabled, maxSize)
- Update GestureConfiguration with palm rejection fields
- Update UserPreferences.gestureConfig to include new options
* feat: add persistence for palm rejection preferences
- Add UserDefaults keys for exclusion zone settings
- Add UserDefaults keys for modifier key settings
- Add UserDefaults keys for contact size filter settings
- Register defaults for all new preferences
- Update loadPreferences() to load new settings
- Update savePreferences() to persist new settings
* feat: implement palm rejection touch filtering
- Add modifier key check at start of processTouches()
- Filter touches in exclusion zone (bottom of trackpad)
- Filter touches exceeding max contact size threshold
- Add getModifierFlags() helper using CGEventSource
- Cancel active gesture if modifier key released
* feat: add Palm Rejection submenu to Advanced menu
- Add createPalmRejectionMenu() with three sections
- Add exclusion zone toggle and size options (10-25%)
- Add modifier key toggle and key type selector
- Add contact size filter toggle and threshold options
- Add action methods for all new preferences
- Dynamically show/hide options based on toggle state
* refactor: Pass modifier flags to gesture recognizer from main thread for reliable state.
* test: add palm rejection configuration and ModifierKeyType tests
- Add tests for GestureConfiguration palm rejection defaults
- Add tests for UserPreferences palm rejection defaults
- Add test for UserPreferences -> GestureConfiguration mapping
- Add tests for ModifierKeyType display names and raw values
- Add test for ModifierKeyType CaseIterable conformance
* test: add GestureRecognizerTests for palm rejection filters
- Add new test file GestureRecognizerTests.swift with 12 tests
- Add tests for modifier key requirement (all 4 types)
- Add tests for exclusion zone filtering
- Add tests for contact size filtering
- Add combined filter test
- Add GestureRecognizer.swift to test target
Includes MockGestureRecognizerDelegate for testing callbacks.
* docs: fix misleading comment about thread context
The comment claimed modifier flags were captured on the main thread,
but deviceMonitor callback actually runs on a framework-managed
background thread. CGEventSource.flagsState is thread-safe per Apple
docs, so this is fine, but the comment was inaccurate.
* test: add partial filter tests for palm rejection
Add 4 new tests for scenarios where some touches are filtered
while others pass palm rejection filters:
- testExclusionZone_PartialFiltering_FiveTouchesThreePass
- testContactSizeFilter_PartialFiltering_FiveTouchesThreePass
- testCombinedFilters_PartialFiltering_SixTouchesThreePass
- testPartialFiltering_InsufficientRemainingTouches
These verify gestures activate when exactly 3 valid touches
remain after filtering, regardless of total touch count.1 parent 7c8e289 commit cb86eb2
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
| 489 | + | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| |||
0 commit comments