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

add proper mouse support #2

Open
3 of 5 tasks
Darukutsu opened this issue Jan 12, 2025 · 3 comments
Open
3 of 5 tasks

add proper mouse support #2

Darukutsu opened this issue Jan 12, 2025 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Darukutsu
Copy link
Owner

Darukutsu commented Jan 12, 2025

see #1

  • add new parsing for mouse to be able to speedup cursor macros 356b97b
  • fix issue with not registering mouse sensitivity (possible libinput limitation) 356b97b this is kinda fixed but not when using mirror replay
  • add somehow ability to record starting position and when repeating script then start from that position 356b97b on wayland you will need to disable mouse acceleration
  • add scrollwheel support
  • fix some mouse buttons not registering
  • I did not include mouse position reset in mirror since it will probably affect games, might change after testing and consultations
@Darukutsu Darukutsu added bug Something isn't working enhancement New feature or request labels Jan 12, 2025
@Darukutsu
Copy link
Owner Author

If you encounter issues revert back to commit ecb242d

@CookieTheory
Copy link
Contributor

Not working in wayland, several issues popping up, some related to fetching starting position, some to x11.

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
failed to create display
Recording to '/tmp/tmp.{...}.macro'.
c0 110
Receiving events...

On play: line 126 bc command not found (bc not listed as dependency)

So, x11 env vars are being called, c0 110 wrongly fetches position of the mouse (if I understood correctly it should print out mouse coords) and bc not listed as dependency to both compositors. I will try to look into wayland side when I get some free time.

@Darukutsu
Copy link
Owner Author

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
failed to create display

this error is due to slurp, setting XDG_RUNTIME_DIR would also solve ydotool socket(at least on my system), so there won't be need for YDOTOOL_SOCKET, however someone still might have custom path. Or if you know better way to cross-compositor fetch current mouse position lets hear it!

I was thinking about reworking privileges in a way that file.macro will get permissions for all to read or maybe better change owner to user who's running script. This way we wouldn't need all hassle with passing env variable to script.
Instead of wrapping up whole script wrap rather only functions which need root privileges.

so maybe create like separate wrapper script which has only libinput functions and permission change for file.macro. Then call it everywhere where those functions are needed from within keystrokes like:

# keystrokes file
...

pkexec wrapper_script "$options" "$USER" "$file" $device_names ...

...

Will be less confusing, with no more -x/-y flags. What do you think?

Also I have no idea how to do this, maybe should be done by default in script.

$  ydotool mousemove --help
...
You need to disable mouse speed acceleration for correct absolute movement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants