Skip to content

Conversation

@fwcd
Copy link
Member

@fwcd fwcd commented Mar 4, 2025

The implementation of the new input API is analogous to the TypeScript implementation (with some tweaks to make the representation of the events more idiomatic in Rust):

Additionally, this refactors the geometry types (Pos, Delta and Rect) to be generic over their type and implements them in terms of a common Vec2 type to avoid duplicate implementations of vector arithmetic. This was necessary to represent floating-point mouse positions, as used in MouseEvent, properly.

Since we rename InputEvent to LegacyInputEvent and introduce a new, unrelated type named InputEvent, this constitutes a source break, hence the version bump to 4.0.0 in 9de6ac1.

@fwcd fwcd added the enhancement New feature or request label Mar 4, 2025
@fwcd fwcd merged commit b8b21fb into main Mar 4, 2025
1 check passed
@fwcd fwcd deleted the new-input-api branch March 4, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants