-
-
Notifications
You must be signed in to change notification settings - Fork 46
fix: Multitouch mode not working properly #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…uches while display off - Removed current code that blocked touches when display is off and tried to turn on display on touch. - Implemented javascript to block touches when display is off, and continues to block for 500ms after display turns on to avoid accidental touches. - Confirmed this method still works in mouse emulation mode. - Added a nice-to-have motion sensor to MQTT, idea taken from `browser_mod 2`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the touch input handling mechanism to fix issues with multitouch mode not properly waking the display and blocking touches while the display is off. The implementation shifts from relying solely on Electron's native event handlers to a hybrid approach that uses JavaScript-based event blocking combined with native event prevention. Additionally, it introduces a motion sensor feature for MQTT integration.
Key changes:
- Replaced native-only touch blocking with JavaScript-injected event blockers that work in both mouse emulation and multitouch modes
- Added periodic polling (100ms interval) to synchronize input blocking state with display status
- Introduced a 500ms grace period after display wakeup to prevent accidental touches
- Added motion detection binary sensor to MQTT that triggers on pointer movement and auto-clears after 5 seconds
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| js/webview.js | Implements new JavaScript-based input blocking with blockAllInput/unblockAllInput functions, adds display wakeup tracking with grace period, introduces periodic polling for input state management, and adds motion detection event emission |
| js/integration.js | Adds motion binary sensor with auto-clearing timer that publishes ON/OFF states via MQTT based on pointer activity |
Add logging a warning when the display status cannot be retrieved Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…chkio into bugfix/MultitouchMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (1)
js/integration.js:20
- Variable 'app' is used before its declaration.
return app.quit();
…d ensure proper cleanup on app exit
|
Implemented relevant Copilot suggestions and tested. Now we're good to go 🚀 |
In light of multitouch mode not working to wake the display and block touches while display is off, I crafted a new method of blocking input and waking the display. Input is now blocked using a more reliable Javascript method that works with both mouse emulation mode and multitouch mode. This may also be able to close #148. If this is accepted,
HARDWARE.mdmay need to be updated.Changes
New features (just a cherry on-top)
browser_mod 2