Touch input unreliable in PsychoPy (pyglet) on Windows 11 touch monitor

**OS**: Windows 11 Pro
**PsychoPy version**: tested on 2024.1.5 and 2026.1.3 (issue persists on both)
**Standard Standalone**: Yes

I’m running a Corsi block-tapping working memory task (Builder, code
component using event.Mouse for touch response) for a clinical population
(stroke/elderly patients), synchronized with fNIRS via LSL markers. Touch
monitor is connected via USB (touch) + HDMI (video), mirrored display.

**Symptom**: Touch recognition inside PsychoPy (pyglet backend) is very
unreliable — taps are frequently missed or not registered, even though:

  • The touchscreen works perfectly as a mouse in every other Windows app
    (Windows confirms “Pen and 10 touch points supported”)
  • Mouse clicks work reliably *inside* PsychoPy

**What I’ve tried**:

  1. pyglet backend (default) — unreliable touch recognition
  2. glfw backend — ImportError, module not installed in standalone build
  3. pygame backend — TypeError, PygameBackend abstract class not fully
    implemented (missing getMousePos, onMouseButton, etc.)
  4. ioHub (io.devices.mouse) — intermittent silent hangs when accessing
    mouse events in a Builder code component
  5. tkinter overlay window running alongside the PsychoPy window in the
    same process — hangs completely (confirmed tkinter itself works fine
    standalone, so this looks like a pyglet/tkinter Win32 message pump
    deadlock)
  6. Updated PsychoPy 2024.1.5 → 2026.1.3 — issue persists identically

I found this related thread confirming the same root cause:

(“touchscreen only works with the Javascript (local or pavlovia) backend”)

Given this, I’m planning to move only the touch-response routine to a
local browser window (PsychoJS/localhost) and bridge the response back
to the Python process via WebSocket, keeping stimulus presentation and
LSL marker sending in Python. Before I invest the time — is this
considered the standard/recommended workaround for local (non-Pavlovia)
studies needing touch + LSL synchronization? Any known pitfalls with
this hybrid Python+local-JS approach, or a simpler officially-supported
path I’m missing?

Happy to share code/tracebacks on request.

This is an issue I’ve had for 20 years (longer than I’ve been using PsychoPy – I first encountered it in SuperLab). Personally I would recommend the contains method for local touchscreens, rather than attempt some form of hybrid experiment.

Thank you so much — this fixed it completely!

For context: I’m running a Corsi-like visuospatial span task (Builder,
fNIRS-synced via LSL) with a Windows touch monitor, and had tried
pyglet, glfw, pygame, and ioHub, all with unreliable or non-functional
touch. Switching from mouse.isPressedIn()/getPressed() to the
hover-based position-change detection you described worked
immediately and reliably — single taps register correctly with no
double-tap or stroke needed.

Really appreciate you sharing this after dealing with it for 20 years.
This will save a lot of people a lot of debugging time. Thank you!