Add command line switches to disable pointer and touch

I am using a wireless keyboard with an integrated touchpad.
I do neither need nor want the touchpad, but I am unable to
attach the keyboard only (without the pointer device) to my
computer. I therefore find it convenient to simply disable
that device when starting `cage`. The switch for disabling
touch input is there for consistency. Maybe it comes in handy
to someone else at some point.

I don't have any previous experience with wayland, so there is
a chance that I simply missed some environment variable that
accomplishes the same. In this case, this commit would be
unnecessary.

The command line switches `P` and `T` are quite ad-hoc. I probably
would have gone for `--disable-pointer` and `--disable-touch` if
long command line switches had already been in use. If someone has
a better idea than `P` and `T`, please suggest it.
This commit is contained in:
Frank Seifferth 2021-02-28 14:06:17 +01:00
parent efaf76e9ab
commit 4934225759
4 changed files with 24 additions and 4 deletions

6
seat.c
View file

@ -390,10 +390,12 @@ handle_new_input(struct wl_listener *listener, void *data)
handle_new_keyboard(seat, device);
break;
case WLR_INPUT_DEVICE_POINTER:
handle_new_pointer(seat, device);
if(!seat->server->disable_pointer)
handle_new_pointer(seat, device);
break;
case WLR_INPUT_DEVICE_TOUCH:
handle_new_touch(seat, device);
if(!seat->server->disable_touch)
handle_new_touch(seat, device);
break;
case WLR_INPUT_DEVICE_SWITCH:
wlr_log(WLR_DEBUG, "Switch input is not implemented");