Skip to content

[p5.js 2.0 Beta Bug Report]: mouseButton returns false #7753

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

Closed
1 of 17 tasks
DylanBKendall opened this issue Apr 17, 2025 · 3 comments
Closed
1 of 17 tasks

[p5.js 2.0 Beta Bug Report]: mouseButton returns false #7753

DylanBKendall opened this issue Apr 17, 2025 · 3 comments

Comments

@DylanBKendall
Copy link

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.0

Web browser and version

Brave Version 1.77.97

Operating system

Windows

Steps to reproduce this

If you simply left click, this print statement will return false

function mousePressed() {
print(mouseButton === LEFT);
}

@mudit06mah
Copy link

Can this issue be assigned to me?

@mudit06mah
Copy link

Actually, I noticed that mouseButton is actually an object and when you access mouseButton.left it is actually returning true.

@ksen0
Copy link
Member

ksen0 commented Apr 29, 2025

Thanks for the follow up @mudit06mah ! I'll close this for now as this is more of a difference between the 1.x events and the 2.x events. If you're interested in improving the documentation on transitioning sketches form 1.x to 2.x events usage, I've made an issue hre: processing/p5.js-compatibility#23

If you find bugs with mouseButton in 2.x please feel free to reopen or report a new issue!

@ksen0 ksen0 closed this as completed Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants