processing / processing/processing-website

Prevent mouse events from being captured by a live sketch when the cursor is not hovering it

Open
#310 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Examples Help Wanted
Dominant language
MDX
Stars
90
Forks
122
Avg merge
1h 43m
Merged PRs (30d)
3

Description

Current behavior
Mouse clicks register in interactive sketches even when the cursor is not over the sketch window (like clicking on links anywhere in the page). This is particularly problematic in examples like FileIO/SaveOneImage where any click triggers a file save.

Expected behavior
Mouse clicks only register when the cursor is over the sketch window

Possible solution
Embed the sketches into an iFrame. See @trikaphundo's first comment below

The following examples are using MousePressed to capture clicks and may need to be fixed

  • Camera/Orthographic
  • Input/MouseFunctions
  • Structure/Loop
  • Structure/Redraw
  • Web/EmbeddedLinks
  • Avanced Data/ArrayListClass
  • Advanced Data/LoadSaveJSON
  • Advanced Data/LoadSaveTable
  • Cellular Automata/Wolfram
  • FileIO/SaveOneImage
  • GUI/Button
  • Motion/MovingOnCurves
  • Simulate/Flocking
  • Simulate/ForcesWithVectors
  • Simulate/MultipleParticleSystems

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that embeds live sketches and reproduce the issue by clicking outside a sketch window, especially with FileIO/SaveOneImage. Done means mouse clicks register only while the cursor is over the sketch, including for the listed affected examples.

Written by the indexing model from the issue text.

Assessment

Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.