moverest / wl-kbptr

Control the mouse pointer with the keyboard on Wayland.
GNU General Public License v3.0
43 stars 4 forks source link

Scrolling #10

Closed matejdro closed 1 week ago

matejdro commented 3 weeks ago

Hello.

Thanks for this utility, it's super useful as a replacement for warpd on Wayland.

I realise that button simulation is more handled by sway, but I was wondering if there is a way to simulate mouse wheel scrolling under cursor?

There does not appear to be a seat command for scrolling.

moverest commented 3 weeks ago

I'm not really sure either how it works with the Sway commands from reading the documentation.

From sway-input(5):

seat cursor press|release button[1-9]|\<event-name-or-code>

Simulate pressing (or releasing) the specified mouse button on the specified seat. The button can either be provided as a button event name or event code, which can be obtained from libinput debug-events, or as an x11 mouse button (button[1-9]). If using button[4-7], which map to axes, an axis event will be simulated, however press and release will be ignored and both will occur.

Deprecated: use the virtual-pointer Wayland protocol instead.

Having said that, it says that this is deprecated so I'm thinking of adding a CLI for the sole purpose of simulating these events. It should be pretty straightforward to implement from reading wayvnc's code.

matejdro commented 1 week ago

This appears to be possible using wlctrl activity:

wlrctl pointer scroll 10 0