moverest / wl-kbptr

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

Is it possible to make this compatible with the 'hide when typing' setting in sway? #8

Closed rivke41levp656 closed 4 months ago

rivke41levp656 commented 4 months ago

When seat * hide_cursor when-typing enable is enabled in sway config, any keypress in 'Mouse' mode hides the cursor. Is there a way to have the cursor stay visible until the user returns to 'default' mode?

moverest commented 4 months ago

This in your Sway configuration should do what you want:

bindsym Shift+a seat * hide_cursor when-typing disable, exec 'wl-kbptr, seat * hide_cursor when-typing enable

Note however that wl-kbptr will not move the cursor until the very end so having the cursor doesn't really do much. Instead it draws a red cross representing where the cursor will land when the user presses g, h, b, Space or Enter:

image

image

rivke41levp656 commented 4 months ago

The reason I wanted the cursor visible is for actions such as:

right-click --> hjkl movement --> left click

I guess changing the binds to this works: bindsym Escape seat * hide_cursor when-typing enable, mode default bindsym $super+g seat * hide_cursor when-typing disable, mode Mouse

moverest commented 4 months ago

Oh I see now, it makes sense here.