Skip to content

Conversation

@TKanX
Copy link
Member

@TKanX TKanX commented Jul 22, 2025

Summary:

Enhances the renderer's event system by expanding the range of supported event types in addEventListener. Previously limited to a few specific events, the renderer now handles a comprehensive set of standard browser interaction events, including detailed mouse (mousedown, mouseup, dblclick), drag-and-drop (dragenter, dragleave), and touch (touchstart, touchmove, touchend) events. This provides developers with finer-grained control to build more complex and custom user interactions.

Changes:

  • Expanded Event Listener Capabilities:

    • The _initEventListeners method in renderer.js has been updated to attach listeners for a wider range of events.
    • Newly supported events include:
      • Mouse Events: dblclick, mousedown, mouseup
      • Drag & Drop Events: dragenter, dragleave
      • Touch Events: touchstart, touchmove, touchend, touchcancel
    • All new pointer, mouse, touch, and drag events correctly resolve the piece index at the event's coordinates and pass it to the listener function.
  • Updated API Documentation:

    • The addEventListener and removeEventListener sections in API.md have been updated.
    • The list of supported eventType values now includes all the newly added events, providing a clear reference for developers.

@TKanX TKanX self-assigned this Jul 22, 2025
Copilot AI review requested due to automatic review settings July 22, 2025 23:36
@TKanX TKanX added documentation 📖 Improvements or additions to documentation enhancement ✨ New feature or request labels Jul 22, 2025
@TKanX TKanX linked an issue Jul 22, 2025 that may be closed by this pull request
1 task
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR expands the renderer's event system to support a comprehensive set of browser interaction events beyond the previously limited selection. The changes enable developers to handle detailed mouse interactions, drag-and-drop operations, and touch events for building more sophisticated user interfaces.

Key changes include:

  • Addition of 9 new event types: dblclick, mousedown, mouseup, dragenter, dragleave, touchstart, touchmove, touchend, and touchcancel
  • Updated API documentation to reflect the expanded event support
  • Reorganized event configuration array for better logical grouping

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/renderer.js Expanded event listener configuration to include new mouse, drag, and touch events; updated JSDoc comments to remove specific event type listings
docs/API.md Updated documentation for addEventListener and removeEventListener methods to list all supported event types with clear categorization

@TKanX TKanX merged commit 4e14f9e into main Aug 16, 2025
14 checks passed
@TKanX TKanX deleted the feature/48-implement-new-pointer-based-interaction-events-in-renderer branch August 16, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📖 Improvements or additions to documentation enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement New Pointer-Based Interaction Events in Renderer

2 participants