Skip to content

mousePressed / touchStarted not working on iOS Safari #8401

@rxg962

Description

@rxg962

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)

p5.js version

2.1.1

Web browser and version

iOS 26

Operating system

iOS

Steps to reproduce this

2 Steps:

  1. Open THIS SKETCH on Safari on iOS
  2. Press any button

I have a keyPressed() function in the button class.

function screenInteract() {  
button.keyPressed(); 
} 

function mousePressed() {   
screenInteract(mouseX, mouseY); 
} 

function touchStarted() {
if (touches.length > 0) {
    screenInteract(touches[0].x, touches[0].y);
  }
  return false;
}

function touchEnded() {
if (touches.length > 0) {
    screenInteract(touches[0].x, touches[0].y);
  }
  return false;
}

This does work on Chrome on Android. Any help appreciated!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions