Skip to content

CursorState::Grab does not report mouse delta on macOS #165

Closed

Description

@mystal

You still get MouseMoved events with the absolute position of the mouse, but it does not change. As a result, it's kind of useless. According to macOS documentation, you should instead check for deltaX and deltaY on the NSEvent.

As far as I can tell, winit doesn't currently report the mouse cursor delta in any events. I think it makes sense to add the mouse delta to the MouseMoved event. Any thoughts?

Activity

  1. Ralith commented on May 10, 2017

    @Ralith
    Contributor

    #164 introduced API for raw input events, which is more appropriate for things like first-person camera control. Would it make more sense to extend the macos backend with support generating such events? It seems to me that you generally want either high-resolution unfiltered relative mouse movement data or filtered window-space pointer positions, not filtered window-space relative pointer movement, and not both at once.

  2. LPGhatguy commented on May 22, 2017

    @LPGhatguy
    Contributor

    @Ralith Will we need a new DeviceEvent variant for mouse movement based on the API you introduced? I see that it exposes an axis and an f64 value, which might not be suitable for platforms like Windows where raw input is reported as one event from the OS

  3. Ralith commented on May 22, 2017

    @Ralith
    Contributor

    As discussed on IRC, the intention of DeviceEvent is explicitly that multiple events be generated if a host even contains motion on multiple axes. For example, an X11 device event may represent motion on arbitrarily many axes at once, but instead of introducing a dynamically allocated vector, we just generate N separate motion events.

    edit for posterity: @LPGhatguy has convinced me that it's worth having input device class specific event types for the sake of API usability.

  4. added
    H - help wanted
    DS - appkit
    D - average
    P - normal
    S - platform parity
    on May 6, 2018
  5. swiftcoder commented on Jun 29, 2019

    @swiftcoder
    Contributor

    This is complete, right? DeviceEvent::MouseMotion has existed for some time now.

  6. added a commit that references this issue on Jan 5, 2022
    acf666b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    D - averageDS - appkitH - help wantedP - normalS - platform parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions