Skip to content
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

Retrieve raw mouse inputs in addition to x and y. #91

Open
Swiiip opened this issue Sep 22, 2020 · 9 comments
Open

Retrieve raw mouse inputs in addition to x and y. #91

Swiiip opened this issue Sep 22, 2020 · 9 comments

Comments

@Swiiip
Copy link

Swiiip commented Sep 22, 2020

Hello,

First, thank you for this library, it is very helpful.
I was wondering if we could get the raw input from the mouse in addition to the current mouse position. I'm working on an app to share a pointer between a mac and a pc, and I would like to keep tracking the delta of the mouse when the pointer reaches one of the screen borders.

Thanks

@kwhat
Copy link
Owner

kwhat commented Sep 22, 2020

It is not available directly, but it should be fairly easy to calculate with the monitor info. If you have some ideas, let me know and we can probably add it in 1.3+

@Swiiip
Copy link
Author

Swiiip commented Sep 22, 2020

The problem is when I reach x = 0 for instance, and I still move my mouse to the left, the x coordinate remains 0 and I can't compute the delta.

@kwhat
Copy link
Owner

kwhat commented Sep 22, 2020

Ah i see, it definitely sounds like something that should be added although I will have to dig into it to determine if it is possible.

@kwhat kwhat self-assigned this Sep 22, 2020
@kwhat kwhat added this to the 1.3 milestone Sep 22, 2020
@kwhat
Copy link
Owner

kwhat commented Sep 22, 2020

X11: https://github.com/kwhat/libuiohook/blob/1.2/src/x11/input_hook.c#L474 there is also a event(X|Y) but I don't know if that will get us where we need to go...

@kwhat
Copy link
Owner

kwhat commented Sep 23, 2020

It's not looking promising, x11 does not appear to support relative mouse movement among other things. This may change if wayland ever goes mainstream but I wouldn't hold my breath. There are some hack-arounds to this issue but they involve resetting the mouse to the middle of the screen which would break things for people that still need to use the mouse. I maybe able to hack something together like the uiohook_event->reserved buffer but it would only be available on some platforms.

@kwhat
Copy link
Owner

kwhat commented Sep 23, 2020

This may contain a workable solution via XTranslateCoordinates but I will have to play around with it. The reason we are starting with X11 is because its the shittiest of the supported platforms and if we can get it working here it should work everywhere else.

@kwhat
Copy link
Owner

kwhat commented Sep 28, 2021

I think this is a duplicate of issues/21.

@kwhat kwhat added duplicate and removed question labels Sep 28, 2021
@kwhat kwhat removed their assignment Jun 23, 2023
@kwhat kwhat modified the milestones: 1.3, 2.0 Jun 23, 2023
@kwhat
Copy link
Owner

kwhat commented Jun 23, 2023

This is going to wait until linux gets a rewrite.

@kwhat kwhat modified the milestones: 2.0, 1.3 Dec 6, 2023
@kwhat
Copy link
Owner

kwhat commented Dec 6, 2023

Evdev support for Linux is nearly complete and the pull request should cover Windows and OSX for relative mouse events. It's technically not direct input on these platforms but it should allow the tracking of the mouse beyond the border of the screen.

@kwhat kwhat removed the duplicate label Dec 6, 2023
@kwhat kwhat added the blocked label Apr 13, 2024
@kwhat kwhat removed this from the 1.3 milestone Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants