Skip to content

MouseEvent and KeyEvent references are missing #631

Open

Description

@KeesR

Select the type of content error.

Other content error (please specify)

Section

Reference

Location of the error

https://processing.org/reference/mouseWheel_.html

Describe the error

There are no reference sections for MouseEvent and KeyEvent.
All mouse*() key*() methods accept such an object, but most reference pages for these methods have no examples for it (one exception: https://processing.org/reference/mouseWheel_.html).

Suggested correction

Suggestion 1:

  • Add reference pages for these classes.

  • Add a few examples of their use.

Suggestion 2:

  • describe that for all practical end-user scenarios the global variables (like mouseX, mousePressed, key, keyCode, etc.) contain all necessary information; in that case, I would suggest to even remove the methods taking an event from the documentation.

  • mouseWheel() could be exception: the getCount() method is not backed by a global.

Language

EN

Screenshots or references

No response

Additional context

No response

Activity

  1. yashodipmore commented on Jun 16, 2025

    @yashodipmore

    @KeesR I'd love to work on these issues. Could you please assign them to me?

  2. yashodipmore commented on Jun 19, 2025

    @yashodipmore

    @SableRaf

    Solution Ready for Review

    I've implemented a comprehensive solution for this issue and submitted PR #632 .

    What's Included:

    Complete MouseEvent class reference - All methods documented (getX, getY, getButton, getCount, modifier keys)
    Complete KeyEvent class reference - All methods documented (getKey, getKeyCode, modifier keys, isAutoRepeat)
    Enhanced all mouse/key functions - Updated mousePressed(), keyPressed(), etc. to document event parameters
    6 comprehensive examples - Practical demonstrations of event object usage
    Spanish translations - Full internationalization support
    Cross-references updated - Proper linking throughout documentation

    Addresses Both Suggestions:

    1. Added reference pages for MouseEvent and KeyEvent classes
    2. Provided multiple examples showing practical usage patterns
    3. Special focus on mouseWheel() with getCount() method documentation

    Key Files Added:

    • MouseEvent.json + Spanish translation
    • KeyEvent.json + Spanish translation
    • 6 new example files with real-world usage scenarios
    • Enhanced documentation for all mouse/keyboard functions

    The solution provides everything users need to effectively work with mouse and keyboard event objects, with clear guidance on when to use event objects vs global variables.

    Ready for maintainer review!

  3. yashodipmore commented on Jun 19, 2025

    @yashodipmore
  4. KeesR commented on Jun 19, 2025

    @KeesR
    Author

    Thank you a lot, yashodipmore ! Very comprehensive and complete, with nice examples.

    Let me know when you expect me to close the ticket. Also fine if SabelRaf will do this after his pull request review.

  5. yashodipmore commented on Jun 19, 2025

    @yashodipmore

    @KeesR Thank you! I’m glad the solution worked well.
    Just a quick note the pull request hasn’t been merged yet. Once it’s reviewed and approved (possibly by SabelRaf), the issue can be closed.
    Please let me know if any changes are needed on my end. I’m happy to update the PR if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions