Skip to content

Fix #631: Add MouseEvent and KeyEvent reference documentation #632

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yashodipmore
Copy link

@yashodipmore yashodipmore commented Jun 19, 2025

Fixes Issue #631

This PR completely resolves the missing MouseEvent and KeyEvent reference documentation issue by adding comprehensive class references, updating all related function documentation, and providing practical examples.

Problem Summary

The Processing website was missing reference pages for MouseEvent and KeyEvent classes. Users could see methods like mousePressed(event) and keyPressed(event) in function signatures but had no documentation about:

  • What these event objects contained
  • How to use their methods (getX(), getY(), getButton(), getCount(), etc.)
  • When to use event objects vs global variables
  • How to detect modifier keys (Shift, Ctrl, Alt, Meta)

Solution Implemented

New Class References Created

  • MouseEvent class - Complete reference with 8 documented methods
  • KeyEvent class - Complete reference with 8 documented methods
  • Spanish translations - Full internationalization support for both classes

Enhanced Function Documentation

Updated 8 core functions to include event parameter documentation:

  • mousePressed(), mouseReleased(), mouseClicked()
  • mouseMoved(), mouseDragged(), mouseWheel()
  • keyPressed(), keyReleased(), keyTyped()

Comprehensive Examples Added

Created 6 new example files demonstrating:

  • Basic MouseEvent usage with button detection and coordinates
  • Advanced mouse wheel interactions with modifier keys
  • KeyEvent usage with modifier key combinations
  • Keyboard event logging and auto-repeat detection
  • Real-world scenarios like interactive drawing and text input

Files Added/Modified

New Files (10):

Screenshot 2025-06-19 110418
Screenshot 2025-06-19 110336

Copy link

netlify bot commented Jun 19, 2025

Deploy Preview for java-processing-faf822 ready!

Name Link
🔨 Latest commit 58b3bc1
🔍 Latest deploy log https://app.netlify.com/projects/java-processing-faf822/deploys/6853a1994ebd450008703788
😎 Deploy Preview https://deploy-preview-632--java-processing-faf822.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SableRaf
Copy link
Collaborator

SableRaf commented Jun 20, 2025

Thank you for your contribution!

I wanted to flag a few issues with this PR:

  • The .pde example files are technically correct, which is appreciated. However, they’re too long for inclusion in the reference and include a number of redundant comments. Please revise them to be shorter and more to the point.
  • The MOUSEEVENT_KEYEVENT_SOLUTION.md file doesn’t belong in this repo and appears out of place. Please remove it.
  • The .json reference files shouldn’t be created or edited manually. They’re auto-generated from Javadoc comments in the Processing source using the doclet script. To make updates, please edit the Javadoc in the relevant Processing repo and re-generate the .json files. Otherwise, your changes will be overwritten the next time the doclet is run.

All of this is explained in the reference workflow documentation. I know the contributor docs can feel like a lot, and it’s not always clear which parts are essential for a given change, but if something’s confusing or unclear, please never hesitate to ask.

Note: Before jumping into a big PR, it’s usually a good idea to start a discussion with us in the issue first. That gives us a chance to talk through the idea together, point you to relevant parts of the code or docs, and make your PR more likely to be accepted.

Thanks again for taking the time to contribute. Let me know if you have any questions.

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.

2 participants