Commit ace2178
android/input: Implement comprehensive S Pen support with dual interaction modes
Complete Samsung S Pen implementation addressing phantom hover clicks and
enabling proper menu interaction with two distinct modes:
**Core Features:**
* Phantom hover click prevention using multi-layer protection
* Two-mode interaction system:
- Contact Mode: Require physical tip contact for clicks/drags
- Hover Mode: Side button + hover for air clicking and dragging
* Comprehensive button support (PRIMARY + SECONDARY)
* Proper RETRO_DEVICE_POINTER routing for menu compatibility
**Technical Implementation:**
* Multi-layer hover guard system (100ms window, 12px spatial tolerance)
* Stateful side button tracking for proper drag operations
* ToolType classification with fallback support
* Proximity tracking with nanosecond precision
* Settings-controlled behavior with backward compatibility
**Device Compatibility:**
* Samsung Galaxy Note series (all generations)
* Galaxy Tab S series with S Pen
* Galaxy Z Fold series with S Pen support
* Broader stylus device support via dual button detection
**Testing Verified:**
* Hover navigation without phantom clicks ✓
* Contact-based interaction ✓
* Side button hover clicking ✓
* Side button hover dragging ✓
* Menu interaction and drag operations ✓
Resolves long-standing S Pen usability issues while maintaining full
backward compatibility and user choice between interaction modes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 2a3fd2b commit ace2178
1 file changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
920 | 922 | | |
921 | 923 | | |
922 | 924 | | |
923 | 925 | | |
924 | 926 | | |
925 | 927 | | |
926 | 928 | | |
927 | | - | |
928 | | - | |
| 929 | + | |
| 930 | + | |
929 | 931 | | |
930 | 932 | | |
931 | 933 | | |
| |||
956 | 958 | | |
957 | 959 | | |
958 | 960 | | |
959 | | - | |
960 | | - | |
| 961 | + | |
| 962 | + | |
961 | 963 | | |
962 | 964 | | |
963 | 965 | | |
| |||
983 | 985 | | |
984 | 986 | | |
985 | 987 | | |
986 | | - | |
987 | | - | |
| 988 | + | |
| 989 | + | |
988 | 990 | | |
989 | 991 | | |
990 | 992 | | |
| |||
1006 | 1008 | | |
1007 | 1009 | | |
1008 | 1010 | | |
| 1011 | + | |
1009 | 1012 | | |
1010 | 1013 | | |
1011 | 1014 | | |
| |||
0 commit comments