Skip to content

[feat] Expose Tao's raw DeviceEvent #7393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
preco21 opened this issue Jul 10, 2023 · 1 comment · May be fixed by #13396
Open

[feat] Expose Tao's raw DeviceEvent #7393

preco21 opened this issue Jul 10, 2023 · 1 comment · May be fixed by #13396

Comments

@preco21
Copy link

preco21 commented Jul 10, 2023

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.

@temportalflux
Copy link

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

@n1ght-hunter n1ght-hunter linked a pull request May 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📬Proposal
Development

Successfully merging a pull request may close this issue.

2 participants