Feature request: add `setmouse`
currently, I can only move the mouse pointer with the movemouse and movemouse-accel actions, which which move the pointer relative to its current position. but i wanna make a mouse layer which moves the pointer to a specific position on the screen.
the only way i could think of doing it in the current version of kanata is by creating a macro which moves the mouse pointer to one of the corners of the screen and then move it to the position i want, but that's pretty tedious.
i'd like if there was a setmouse action which would take in an x and y value and then set the position of the mouse pointer to those coordinates, for example (setmouse 540 960) would move the mouse pointer to the center of a 1080p screen. this would help out my workflow a ton.
Implementation notes in case someone wants to try their hand at this:
SendInput:
MOUSEEVENTF_ABSOLUTE in https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput
Interception: https://docs.rs/interception/latest/interception/struct.MouseFlags.html#associatedconstant.MOVE_ABSOLUTE
Linux: https://docs.rs/evdev/0.12.1/evdev/struct.AbsoluteAxisType.html https://docs.rs/evdev/0.12.1/evdev/uinput/struct.VirtualDeviceBuilder.html#method.with_absolute_axis
Hmm looks like on Linux at least, the absolute axis is not usable for moving the mouse cursor.
https://stackoverflow.com/questions/5190921/simulating-absolute-mouse-movements-in-linux-using-uinput
On Linux there's already a pretty good keyboard-mouse solution in warpd though, so could use that instead. https://github.com/rvaiya/warpd
Implemented in Windows in #373.
Looks like to do this properly in Linux, need to work with X and Wayland instead of using uinput, which is a bit unfortunate. Or one could use warpd as suggested in the previous comment.
yeah i wanted setmouse so i could create something like warpd on windows (just without the visual guides) lol, looks pretty good.
didn't realize i accidentally closed this issue, my bad.