wl-kbptr — short for Wayland Keyboard Pointer — is a utility to help move the mouse pointer with the keyboard.
It works in two phases: the screen is first in mapped with three letter labels and then the selected area is refined by bisecting it. At any point the cursor can be moved at the location marked by the red marker by pressing Enter or Space. A left, right and middle click can be made by pressing the g, h and b keys respectively.
Note that your compositor needs to support the wlr-layer-shell-unstable-v1 and wlr-virtual-pointer-unstable-v1 protocols.
If you are using Arch Linux, you can install the wl-kbptr AUR package.
Otherwise, you can build it with:
meson build
meson compile -C buildThen install with:
meson install -C buildmode Mouse {
bindsym a mode default, exec 'wl-kbptr-sway-active-win; swaymsg mode Mouse'
bindsym Shift+a mode default, exec 'wl-kbptr; swaymsg mode Mouse'
# Mouse move
bindsym h seat seat0 cursor move -15 0
bindsym j seat seat0 cursor move 0 15
bindsym k seat seat0 cursor move 0 -15
bindsym l seat seat0 cursor move 15 0
# Left button
bindsym s seat seat0 cursor press button1
bindsym --release s seat seat0 cursor release button1
# Middle button
bindsym d seat seat0 cursor press button2
bindsym --release d seat seat0 cursor release button2
# Right button
bindsym f seat seat0 cursor press button3
bindsym --release f seat seat0 cursor release button3
bindsym Escape mode default
}
bindsym $mod+g mode Mouse
wl-kbptr can be configured with a configuration file. See config.example for an example and run wl-kbptr --help-config for help.