Sway: Cannot disable an input device

Created on 16 Jan 2019  路  21Comments  路  Source: swaywm/sway

Using swaymsg input <identifier> events disabled (with identifiers taken from swaymsg -t get_inputs), I can disable many devices (trackpad, mouse, internal and external keyboard) but not my wacom pen. Any idea?

Edit: I was able to disable it with xinput --disable 'Wacom ISDv4 EC Pen' under X11 with libinput, so that should not be a libinput issue.

enhancement

All 21 comments

Can you send a debug log?

Debug log. I started sway with sway -d 2> ~/sway.log then ran swaymsg input 1386:236:Wacom_ISDv4_EC_Pen events disabled followed by swaymsg exit.

Weird, it seems we do call libinput_device_config_send_events_set_mode(dev, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED) (line 1379).

Any idea how I can track that further?

Can you please post a log using this branch https://github.com/RedSoxFan/sway/tree/libinput-send-events-verbose? I added some code to check the status returned by libinput_device_config_send_events_set_mode

I got a build failure:

/usr/bin/ld: sway/345c74e@@sway@exe/desktop_xdg_shell.c.o: in function `_close':
/tmp/makepkg/sway-git/src/build/../sway/sway/desktop/xdg_shell.c:236: undefined reference to `wlr_xdg_toplevel_send_close'
/usr/bin/ld: sway/345c74e@@sway@exe/desktop_xdg_shell.c.o: in function `close_popups_iterator':
/tmp/makepkg/sway-git/src/build/../sway/sway/desktop/xdg_shell.c:246: undefined reference to `wlr_xdg_popup_destroy'

Please upgrade wlroots.

The issue seems to be (full debug log):

[input-manager.c:202] input_manager_libinput_config_pointer(1386:236:Wacom_ISDv4_EC_Pen)
[input-manager.c:276] libinput_config_pointer(1386:236:Wacom_ISDv4_EC_Pen) send_events_set_mode(1)
[input-manager.c:281] Unsupported event mode 1
[input-manager.c:284] Supported bitmask: 0

That's surprising as xinput --disable used to work. I guess sway should also report a failure?

That's surprising as xinput --disable used to work. I guess sway should also report a failure?

Personally, I think every device should be allowed to be either enabled or disabled _(disabled_on_external_mouse is a different story)_. I guess we could guard input handlers and ignore the input event if the device is desired to be disabled.

Note that events disabled doesn't necessarily mean it's completely disabled.

Note that events disabled doesn't necessarily means it's completely disabled.

True. Should we add actual enable/disable commands then?

I'm not opposed to it, but this will become confusing for users. We'll need to write docs for this. Maybe we could rename events disabled to something else? (But then it's not consistent with libinput's naming)

If we do add enable and disable, the only event mode that I see useful is disabled_on_external_mouse. Maybe we could just change that to disabled_on_external_mouse true|false? Maybe I'm missing a case where you would want the device to be enabled, but not send events?

Also, should disable remove the seat capability (if it is the last keyboard, pointer, etc)?

(Context about "doesn't necessarily mean it's completely disabled")

The Send Events Mode is libinput鈥檚 terminology for disabling a device. It is more precise in that the device only stops sending events but may not get fully disabled. For example, disabling the touchpad on a Lenovo T440 and similar leaves the top software buttons enabled for the trackpoint. Available options are enabled (send events normally), disabled ( do not send events), disabled on external mouse (disable the device while an external mouse is plugged in).

https://wayland.freedesktop.org/libinput/doc/latest/configuration.html

I don't get why events disabled isn't supported for the device. Maybe we should ask libinput devs about this?

After looking at the libinput source, it appears that libinput supports LIBINPUT_CONFIG_SEND_EVENTS_DISABLED for all devices, except tablet tools.

Bizzare.

After looking at the libinput source, it appears that libinput supports LIBINPUT_CONFIG_SEND_EVENTS_DISABLED for all devices, except tablet tools.

that's a bug, please file one in libinput for this. tablets have a different backend so I probably forgot to implement this bit there and no-one noticed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddevault picture ddevault  路  129Comments

ddevault picture ddevault  路  76Comments

tmccombs picture tmccombs  路  27Comments

ghost picture ghost  路  36Comments

ddevault picture ddevault  路  30Comments