Skip to content

Distinction between MouseMotion and CursorMoved events is unclear in docs #5083

@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

As shown in the mouse_input_events example, Bevy exposes both a MouseMotion and CursorMoved event type.

These are poorly documented, but it appears that MouseMotion is relative, while CursorPosition is absolute (and tied to a specific window).

What solution would you like?

Clearly differentiate these types in the docs and explain why they both exist (and when you should use one vs the other).

What alternative(s) have you considered?

Remove MouseMotion, and only expose CursorMoved. However, it's not clear if MouseMotion can always be reconstructed; I'm particularly nervous about what happens when the cursor is locked to the screen.

Additional context

Related to #5034, which also tries to simplify the UX here.

Metadata

Metadata

Assignees

Labels

A-InputPlayer input via keyboard, mouse, gamepad, and moreC-DocsAn addition or correction to our documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions