Skip to content

Conversation

@CU-Jon
Copy link

@CU-Jon CU-Jon commented Dec 5, 2025

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.md may need to be updated.

Changes

  • 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.

New features (just a cherry on-top)

  • Added a nice-to-have motion sensor to MQTT, idea taken from browser_mod 2

…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`
Copilot AI review requested due to automatic review settings December 5, 2025 05:08
Copy link

Copilot AI left a 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

CU-Jon and others added 4 commits December 5, 2025 00:17
Copy link

Copilot AI left a 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

    return app.quit();

@CU-Jon
Copy link
Author

CU-Jon commented Dec 5, 2025

Implemented relevant Copilot suggestions and tested. Now we're good to go 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant