Skip to content

[feat] Expose Tao's raw DeviceEvent #7393

@preco21

Description

@preco21

Describe the problem

I'm attempting to capture a mouse move event from raw device input, similar to winput. However, it conflicts with Tauri's message loop and so cannot be used.

After some research, I discovered that Tao actually provides a DeviceEvent that exposes raw mouse move events from the OS.

Is there a way to access it?

  • Platform: Windows
  • Tauri version: 1.4.0

Describe the solution you'd like

I couldn't find the api that exposes the DeviceEvent from Tauri directly, let me know if there's already one there or other ways (like accessing via, say, a raw window handle?) are available.

I'd like to have the DeviceEvent exposed so that I can utilize it for my usecases that requires getting raw device input.

Alternatives considered

  • winput - Conflicts with the Tauri's message loop.
  • multiinput - Not sure what's going on, but it leaks memory.
  • 'mousemove' event from Web api. (see below)

Additional context

What I was trying to achieve is that to capture mouse input while locking the cursor in the center of the app window.

I could use 'mousemove' event from the Web api, but it eventually fails to get relative position because it retreats back to the center position after move, canceling out the points that moved, thus resulting to zero deltas after all.

Activity

temportalflux

temportalflux commented on Mar 20, 2024

@temportalflux

Ditto on this. I'd like to be able to listen for when devices connect or disconnect for querying hardware/firmware for connection status and raw input. I found a fork which hard-wired this in, but it'd be very helpful for some access to wry::event::DeviceEvent to be natively supported. dev...SecretPocketCat:tauri:dev

linked a pull request that will close this issue on May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📬Proposal

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @preco21@temportalflux

      Issue actions

        [feat] Expose Tao's raw `DeviceEvent` · Issue #7393 · tauri-apps/tauri